summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2021-04-16 21:03:14 -0700
committerGitHub <[email protected]>2021-04-16 21:03:14 -0700
commitf4eb7f3a585abd65b0568428b2b9fde8cebffb6a (patch)
tree8710075d4a458bdb31880d7a68f143c3b7a53108 /README.md
parent113aef7114af6135372272d6bb8ac4ceaf3a7a79 (diff)
parent172800ff9a2765185520c06dcf969fde9f5eb5e3 (diff)
Merge pull request #137 from alexflint/optional-long
Optional long names
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index a9555b9..da69469 100644
--- a/README.md
+++ b/README.md
@@ -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
```