udpate readme
This commit is contained in:
parent
19d956870f
commit
b666b30474
12
README.md
12
README.md
|
@ -1,9 +1,5 @@
|
||||||
## Structured argument parsing for Go
|
## Structured argument parsing for Go
|
||||||
|
|
||||||
```shell
|
|
||||||
go get github.com/alexflint/go-arg
|
|
||||||
```
|
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var args struct {
|
var args struct {
|
||||||
Foo string
|
Foo string
|
||||||
|
@ -29,7 +25,7 @@ args.Foo = "default value"
|
||||||
arg.MustParse(&args)
|
arg.MustParse(&args)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Marking options as required
|
### Required options
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var args struct {
|
var args struct {
|
||||||
|
@ -100,6 +96,12 @@ fmt.Printf("Fetching the following IDs from %s: %q", args.Database, args.IDs)
|
||||||
Fetching the following IDs from foo: [1 2 3]
|
Fetching the following IDs from foo: [1 2 3]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
go get github.com/alexflint/go-arg
|
||||||
|
```
|
||||||
|
|
||||||
### Rationale
|
### Rationale
|
||||||
|
|
||||||
There are many command line argument parsing libraries for Go, including one in the standard library, so why build another?
|
There are many command line argument parsing libraries for Go, including one in the standard library, so why build another?
|
||||||
|
|
Loading…
Reference in New Issue