diff options
| author | Alex Flint <[email protected]> | 2016-01-05 14:00:29 -0800 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2016-01-05 14:00:29 -0800 |
| commit | 9aad09fe14abea44e32a2dabf4768e1eb31527ea (patch) | |
| tree | a913cc7e3290a3e03cc2b854b81f06b8246358c0 | |
| parent | f89698667c0b2138445c719101fe7a4d55764738 (diff) | |
fix example code
| -rw-r--r-- | README.md | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -109,17 +109,23 @@ Fetching the following IDs from foo: [1 2 3] ``` ### Custom validation -``` +```go var args struct { Foo string Bar string } p := arg.MustParse(&args) if args.Foo == "" && args.Bar == "" { - p.Fail("you must provide one of --foo and --bar) + p.Fail("you must provide one of --foo and --bar") } ``` +```shell +./example +usage: samples [--foo FOO] [--bar BAR] +error: you must provide one of --foo and --bar +``` + ### Installation ```shell |
