diff options
| author | Andrew Morozko <[email protected]> | 2019-11-30 00:22:21 +0300 |
|---|---|---|
| committer | Andrew Morozko <[email protected]> | 2019-11-30 00:22:21 +0300 |
| commit | c3a019cdb8116ae3b4a928c2a14efd83df7f34aa (patch) | |
| tree | 04b6fdab240fb204221af4a500ca170eaf3972fd /parse_test.go | |
| parent | 904e03926794663089b73d52a02def065d819200 (diff) | |
Various changes
Diffstat (limited to 'parse_test.go')
| -rw-r--r-- | parse_test.go | 11 |
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"` |
