diff options
| author | Alex Flint <[email protected]> | 2021-04-16 21:03:14 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-16 21:03:14 -0700 |
| commit | f4eb7f3a585abd65b0568428b2b9fde8cebffb6a (patch) | |
| tree | 8710075d4a458bdb31880d7a68f143c3b7a53108 /README.md | |
| parent | 113aef7114af6135372272d6bb8ac4ceaf3a7a79 (diff) | |
| parent | 172800ff9a2765185520c06dcf969fde9f5eb5e3 (diff) | |
Merge pull request #137 from alexflint/optional-long
Optional long names
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -244,21 +244,23 @@ someprogram 4.3.0 ```go var args struct { - Short string `arg:"-s"` - Long string `arg:"--custom-long-option"` - ShortAndLong string `arg:"-x,--my-option"` + Short string `arg:"-s"` + Long string `arg:"--custom-long-option"` + ShortAndLong string `arg:"-x,--my-option"` + OnlyShort string `arg:"-o,--"` } arg.MustParse(&args) ``` ```shell $ ./example --help -Usage: [--short SHORT] [--custom-long-option CUSTOM-LONG-OPTION] [--my-option MY-OPTION] +Usage: example [-o ONLYSHORT] [--short SHORT] [--custom-long-option CUSTOM-LONG-OPTION] [--my-option MY-OPTION] Options: --short SHORT, -s SHORT --custom-long-option CUSTOM-LONG-OPTION --my-option MY-OPTION, -x MY-OPTION + -o ONLYSHORT --help, -h display this help and exit ``` |
