diff options
| author | Alex Flint <[email protected]> | 2019-12-01 01:22:05 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-01 01:22:05 -0800 |
| commit | ced05bfe8a0f966d6ed09af656f5410bc5f4ed7c (patch) | |
| tree | 75a1540bde1cf3b46b45854e5043ca2100638888 /parse_test.go | |
| parent | c0c7a3ba8a1854cd85e65cca4f0e2028698a0738 (diff) | |
| parent | 9d4521ce8be4871b3ba85cb1bfa96f4b074f505b (diff) | |
Merge pull request #96 from Andrew-Morozko/master
Added the "placeholder" tag
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"` |
