diff options
| author | Alex Flint <[email protected]> | 2022-02-09 18:04:03 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-09 18:04:03 -0800 |
| commit | f0f44b65d1179ccedb4c56f493f97ec569a6654e (patch) | |
| tree | 0d202fcd6c6a194e8c7c14bbc3af3ed386938fe6 /example_test.go | |
| parent | d3706100bf0cfef2b8f6f9119889541c302d72d1 (diff) | |
| parent | 5fb236a65dd1edf0de556d5bac83a1103b9cf73a (diff) | |
Merge pull request #175 from alexflint/bracketing-positionalsv1.4.3
Fix bracketing for non-required positionals in usage
Diffstat (limited to 'example_test.go')
| -rw-r--r-- | example_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/example_test.go b/example_test.go index 20b9225..fd64777 100644 --- a/example_test.go +++ b/example_test.go @@ -154,7 +154,7 @@ func Example_helpText() { os.Args = split("./example --help") var args struct { - Input string `arg:"positional"` + Input string `arg:"positional,required"` Output []string `arg:"positional"` Verbose bool `arg:"-v" help:"verbosity level"` Dataset string `help:"dataset to use"` @@ -188,7 +188,7 @@ func Example_helpPlaceholder() { os.Args = split("./example --help") var args struct { - Input string `arg:"positional" placeholder:"SRC"` + Input string `arg:"positional,required" placeholder:"SRC"` Output []string `arg:"positional" placeholder:"DST"` Optimize int `arg:"-O" help:"optimization level" placeholder:"LEVEL"` MaxJobs int `arg:"-j" help:"maximum number of simultaneous jobs" placeholder:"N"` @@ -259,7 +259,7 @@ func Example_helpTextWhenUsingSubcommand() { os.Args = split("./example get --help") type getCmd struct { - Item string `arg:"positional" help:"item to fetch"` + Item string `arg:"positional,required" help:"item to fetch"` } type listCmd struct { @@ -389,7 +389,7 @@ func Example_errorText() { os.Args = split("./example --optimize INVALID") var args struct { - Input string `arg:"positional"` + Input string `arg:"positional,required"` Output []string `arg:"positional"` Verbose bool `arg:"-v" help:"verbosity level"` Dataset string `help:"dataset to use"` |
