summaryrefslogtreecommitdiff
path: root/example_test.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2022-02-09 06:31:34 -0800
committerAlex Flint <[email protected]>2022-02-09 06:31:34 -0800
commit5fb236a65dd1edf0de556d5bac83a1103b9cf73a (patch)
tree0d202fcd6c6a194e8c7c14bbc3af3ed386938fe6 /example_test.go
parentd3706100bf0cfef2b8f6f9119889541c302d72d1 (diff)
fix bracketing for non-required positionals
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go8
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"`