Add environment fallback for config path
+ FORMATY_CONFIG is the fallback for the optional config path + If -c is not provided, we go to the system configmain
parent
9244cebad3
commit
ace4b9aa10
16
README.md
16
README.md
|
@ -64,20 +64,20 @@ Formaty 0.1.0
|
||||||
Arbitrary Binary Data Formatting
|
Arbitrary Binary Data Formatting
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
formaty [OPTIONS] <format> [data]...
|
formaty [OPTIONS] <format> [data]...
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
-V, --version Prints version information
|
-V, --version Prints version information
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
-b, --base <base> Base of the input values
|
-b, --base <base> Base of the input values
|
||||||
-c, --config <config> Path to the format config
|
-c, --config <config> Path to the format config [env: FORMATY_CONFIG=]
|
||||||
-i, --input_type <input-type> Input data type [default: array]
|
-i, --input_type <input-type> Input data type [default: array]
|
||||||
|
|
||||||
ARGS:
|
ARGS:
|
||||||
<format> Format to parse data as
|
<format> Format to parse data as
|
||||||
<data>... Raw data
|
<data>... Raw data
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -16,6 +16,7 @@ pub struct Args {
|
||||||
#[structopt(
|
#[structopt(
|
||||||
short = "c",
|
short = "c",
|
||||||
long = "config",
|
long = "config",
|
||||||
|
env = "FORMATY_CONFIG",
|
||||||
parse(from_os_str),
|
parse(from_os_str),
|
||||||
help = "Path to the format config"
|
help = "Path to the format config"
|
||||||
)]
|
)]
|
||||||
|
|
Loading…
Reference in New Issue