summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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?