diff options
| author | Alex Flint <[email protected]> | 2015-11-01 11:40:09 -0800 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2015-11-01 11:40:09 -0800 |
| commit | cd9f5188a8b221ea732e8146a5b8fc75c0498d91 (patch) | |
| tree | c91a3bc94f2da1eb05b8b767ffe7dd42aeeb7f81 /parse.go | |
| parent | beede9329ae104d7db320406a63621b5bda03a36 (diff) | |
fix example
Diffstat (limited to 'parse.go')
| -rw-r--r-- | parse.go | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -1,17 +1,17 @@ // Package arg parses command line arguments using the fields from a struct. // Any exported field is interpreted as a command line option, so // -// var args struct { -// Iter int -// Debug bool -// } -// arg.MustParse(&args) +// var args struct { +// Iter int +// Debug bool +// } +// arg.MustParse(&args) // // defines two command line arguments, which can be set using any of // -// ./example --iter=1 --bar // bar is a boolean flag so its value is optional -// ./example -iter 1 // bar will default to its zero value -// ./example --bar=true // foo will default to its zero value +// ./example --iter=1 --bar // bar is a boolean flag so its value is optional +// ./example -iter 1 // bar will default to its zero value +// ./example --bar=true // foo will default to its zero value // // The fastest way to learn how to use go-arg is to read the examples below. // @@ -20,13 +20,13 @@ // // Tags can be specified using the `arg` package name: // -// var args struct { -// Input string `arg:"positional"` -// Log string `arg:"positional,required"` -// Debug bool `arg:"-d,help:turn on debug mode"` -// RealMode bool `arg:"--real" -// Wr io.Writer `arg:"-"` -// } +// var args struct { +// Input string `arg:"positional"` +// Log string `arg:"positional,required"` +// Debug bool `arg:"-d,help:turn on debug mode"` +// RealMode bool `arg:"--real" +// Wr io.Writer `arg:"-"` +// } // // The valid tag strings are `positional`, `required`, and `help`. Further, any tag string // that starts with a single hyphen is the short form for an argument (e.g. `./example -d`), |
