Add environment fallback for config path
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details

+ FORMATY_CONFIG is the fallback for the optional config path
+ If -c is not provided, we go to the system config
main
Joey Hines 2022-04-21 19:53:02 -06:00
parent 9244cebad3
commit ace4b9aa10
No known key found for this signature in database
GPG Key ID: 80F567B5C968F91B
2 changed files with 9 additions and 8 deletions

View File

@ -64,20 +64,20 @@ Formaty 0.1.0
Arbitrary Binary Data Formatting
USAGE:
formaty [OPTIONS] <format> [data]...
formaty [OPTIONS] <format> [data]...
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-b, --base <base> Base of the input values
-c, --config <config> Path to the format config
-i, --input_type <input-type> Input data type [default: array]
-b, --base <base> Base of the input values
-c, --config <config> Path to the format config [env: FORMATY_CONFIG=]
-i, --input_type <input-type> Input data type [default: array]
ARGS:
<format> Format to parse data as
<data>... Raw data
<format> Format to parse data as
<data>... Raw data
```
## License

View File

@ -16,6 +16,7 @@ pub struct Args {
#[structopt(
short = "c",
long = "config",
env = "FORMATY_CONFIG",
parse(from_os_str),
help = "Path to the format config"
)]