Updated readme
This commit is contained in:
parent
faebd3e0f2
commit
04c3fdbd80
10
README.md
10
README.md
|
@ -244,21 +244,23 @@ someprogram 4.3.0
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var args struct {
|
var args struct {
|
||||||
Short string `arg:"-s"`
|
Short string `arg:"-s"`
|
||||||
Long string `arg:"--custom-long-option"`
|
Long string `arg:"--custom-long-option"`
|
||||||
ShortAndLong string `arg:"-x,--my-option"`
|
ShortAndLong string `arg:"-x,--my-option"`
|
||||||
|
OnlyShort string `arg:"-o,--"`
|
||||||
}
|
}
|
||||||
arg.MustParse(&args)
|
arg.MustParse(&args)
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ./example --help
|
$ ./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:
|
Options:
|
||||||
--short SHORT, -s SHORT
|
--short SHORT, -s SHORT
|
||||||
--custom-long-option CUSTOM-LONG-OPTION
|
--custom-long-option CUSTOM-LONG-OPTION
|
||||||
--my-option MY-OPTION, -x MY-OPTION
|
--my-option MY-OPTION, -x MY-OPTION
|
||||||
|
-o ONLYSHORT
|
||||||
--help, -h display this help and exit
|
--help, -h display this help and exit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue