diff options
| author | Alex Flint <[email protected]> | 2015-11-01 11:34:22 -0800 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2015-11-01 11:34:22 -0800 |
| commit | beede9329ae104d7db320406a63621b5bda03a36 (patch) | |
| tree | 37c49c98e5c03e9d882dd0b5bbc3935f37705003 /README.md | |
| parent | 30befae91a472e767b021961620ac0d93e6ff11d (diff) | |
added runnable examples
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,5 +1,9 @@ +[](https://godoc.org/github.com/alexflint/go-arg) + ## Structured argument parsing for Go +Declare the command line arguments your program accepts by defining a struct. + ```go var args struct { Foo string @@ -43,8 +47,8 @@ var args struct { Output []string `arg:"positional"` } arg.MustParse(&args) -fmt.Println("Input:", input) -fmt.Println("Output:", output) +fmt.Println("Input:", args.Input) +fmt.Println("Output:", args.Output) ``` ``` @@ -102,6 +106,10 @@ Fetching the following IDs from foo: [1 2 3] go get github.com/alexflint/go-arg ``` +### Documentation + +https://godoc.org/github.com/alexflint/go-arg + ### Rationale There are many command line argument parsing libraries for Go, including one in the standard library, so why build another? |
