diff options
| author | Alex Rakoczy <[email protected]> | 2015-12-04 09:59:13 -0500 |
|---|---|---|
| committer | Alex Rakoczy <[email protected]> | 2015-12-04 09:59:13 -0500 |
| commit | e4e9e194271bfee0bc5e60b2f0cb7eee667b10b0 (patch) | |
| tree | 392db774acd9bde999b5ead1f405b4faa5acd460 /usage_test.go | |
| parent | ce5525d7767a3016c46f0f07e26a5db4b26372c1 (diff) | |
Fix error when printing usage for multi-value arguments
We try to compare []strings, which are uncomparable types:
`panic: runtime error: comparing uncomparable type []string`
Diffstat (limited to 'usage_test.go')
| -rw-r--r-- | usage_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usage_test.go b/usage_test.go index 01c9542..07edc18 100644 --- a/usage_test.go +++ b/usage_test.go @@ -10,9 +10,9 @@ import ( ) func TestWriteUsage(t *testing.T) { - expectedUsage := "usage: example [--name NAME] [--value VALUE] [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] INPUT [OUTPUT [OUTPUT ...]]\n" + expectedUsage := "usage: example [--name NAME] [--value VALUE] [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] [--ids IDS] INPUT [OUTPUT [OUTPUT ...]]\n" - expectedHelp := `usage: example [--name NAME] [--value VALUE] [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] INPUT [OUTPUT [OUTPUT ...]] + expectedHelp := `usage: example [--name NAME] [--value VALUE] [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] [--ids IDS] INPUT [OUTPUT [OUTPUT ...]] positional arguments: input @@ -25,6 +25,7 @@ options: --dataset DATASET dataset to use --optimize OPTIMIZE, -O OPTIMIZE optimization level + --ids IDS Ids --help, -h display this help and exit ` var args struct { @@ -35,6 +36,7 @@ options: Verbose bool `arg:"-v,help:verbosity level"` Dataset string `arg:"help:dataset to use"` Optimize int `arg:"-O,help:optimization level"` + Ids []int64 `arg:"help:Ids"` } args.Name = "Foo Bar" args.Value = 42 |
