summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2015-11-01 11:34:22 -0800
committerAlex Flint <[email protected]>2015-11-01 11:34:22 -0800
commitbeede9329ae104d7db320406a63621b5bda03a36 (patch)
tree37c49c98e5c03e9d882dd0b5bbc3935f37705003 /README.md
parent30befae91a472e767b021961620ac0d93e6ff11d (diff)
added runnable examples
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 10 insertions, 2 deletions
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?