summaryrefslogtreecommitdiff
path: root/parse_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'parse_test.go')
-rw-r--r--parse_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/parse_test.go b/parse_test.go
index 47e9ccd..f75d1a7 100644
--- a/parse_test.go
+++ b/parse_test.go
@@ -220,6 +220,17 @@ func TestLongFlag(t *testing.T) {
assert.Equal(t, "xyz", args.Foo)
}
+func TestPlaceholder(t *testing.T) {
+ var args struct {
+ Input string `arg:"positional" placeholder:"SRC"`
+ Output []string `arg:"positional" placeholder:"DST"`
+ Optimize int `arg:"-O" placeholder:"LEVEL"`
+ MaxJobs int `arg:"-j" placeholder:"N"`
+ }
+ err := parse("-O 5 --maxjobs 2 src dest1 dest2", &args)
+ assert.NoError(t, err)
+}
+
func TestCaseSensitive(t *testing.T) {
var args struct {
Lower bool `arg:"-v"`