summaryrefslogtreecommitdiff
path: root/example_test.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2020-08-06 16:52:47 -0700
committerGitHub <[email protected]>2020-08-06 16:52:47 -0700
commit96c756c382ed72665445b9b900e38c99d47f3f66 (patch)
treee68e18ab1eee1205ef45168aebe54d22c1e73b83 /example_test.go
parenta68c3d065362e581a7d09b42d1abc1994520aec6 (diff)
parentc47edd03248733b0f5208ca02682f2161d23a8b9 (diff)
Merge pull request #122 from alexflint/short-and-long
Add examples showing how to override the short and long versions of option
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/example_test.go b/example_test.go
index 4e6372f..9091151 100644
--- a/example_test.go
+++ b/example_test.go
@@ -112,7 +112,7 @@ func Example_helpText() {
Output []string `arg:"positional"`
Verbose bool `arg:"-v" help:"verbosity level"`
Dataset string `help:"dataset to use"`
- Optimize int `arg:"-O,help:optimization level"`
+ Optimize int `arg:"-O,--optim" help:"optimization level"`
}
// This is only necessary when running inside golang's runnable example harness
@@ -121,7 +121,7 @@ func Example_helpText() {
MustParse(&args)
// output:
- // Usage: example [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] INPUT [OUTPUT [OUTPUT ...]]
+ // Usage: example [--verbose] [--dataset DATASET] [--optim OPTIM] INPUT [OUTPUT [OUTPUT ...]]
//
// Positional arguments:
// INPUT
@@ -130,7 +130,7 @@ func Example_helpText() {
// Options:
// --verbose, -v verbosity level
// --dataset DATASET dataset to use
- // --optimize OPTIMIZE, -O OPTIMIZE
+ // --optim OPTIM, -O OPTIM
// optimization level
// --help, -h display this help and exit
}