Mastering jzero
Less than 1 minute
About Configuration
- Supports controlling various parameters through configuration file .jzero.yaml
- Supports controlling various parameters through flag
- Supports controlling various parameters through environment variables
- Supports controlling various parameters through combination of above methods, priority from high to low: environment variables > flag > configuration file
Example: jzero gen --style go_zero corresponds to .jzero.yaml content
.jzero.yaml
gen:
git-change: truejzero gen + .jzero.yaml = jzero gen --git-change=true
For environment variable usage, need to add prefix JZERO_, such as JZERO_GEN_GIT_CHANGE
JZERO_GEN_GIT_CHANGE=go_zero jzero gen = jzero gen --git-change=true
Environment variable definition supports using configuration file, default is .jzero.env.yaml
Example:
.jzero.env.yaml
JZERO_GEN_GIT_CHANGE: trueSubcommands
For subcommand configuration, such as: jzero gen zrpcclient --output client corresponds to .jzero.yaml content
.jzero.yaml
gen:
zrpcclient:
output: clientjzero gen zrpcclient + .jzero.yaml = jzero gen zrpcclient --output client
Also supports environment variable configuration JZERO_GEN_ZRPCCLIENT_NAME
.jzero.env.yaml
JZERO_GEN_ZRPCCLIENT_OUTPUT: clientjzero gen zrpcclient + .jzero.env.yaml = jzero gen zrpcclient --output client
Set working directory
jzero gen -w /path/toSet quiet mode
jzero gen --quietSet debug mode
jzero gen --debug