diff --git a/example/example.go b/example/example.go deleted file mode 100644 index 1b1c7e0..0000000 --- a/example/example.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import "github.com/alexflint/go-arg" - -func main() { - var args struct { - Input string `arg:"positional"` - Output []string `arg:"positional"` - Verbose bool `arg:"-v,help:verbosity level"` - Dataset string `arg:"help:dataset to use"` - Optimize int `arg:"-O,help:optimization level"` - } - arg.MustParse(&args) -} diff --git a/parse.go b/parse.go index 6e92633..f8e8cf4 100644 --- a/parse.go +++ b/parse.go @@ -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`),