From beede9329ae104d7db320406a63621b5bda03a36 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Sun, 1 Nov 2015 11:34:22 -0800 Subject: added runnable examples --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 426c82d..a97cff5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ +[![GoDoc](https://godoc.org/github.com/alexflint/go-arg?status.svg)](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? -- cgit v1.2.3