summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorK3A <[email protected]>2017-03-09 18:25:56 +0100
committerGitHub <[email protected]>2017-03-09 18:25:56 +0100
commitb413f8dfb0b6a402b0c048d3a0c582a9f677f98b (patch)
tree730568a77df398d2e301759125f7287c44935918 /README.md
parent9e6f80aa9097a84b3a55750bb83a2afebedc30f0 (diff)
parente6e0f59a1777b399abbd2ad840811ad5d6bab04e (diff)
Merge branch 'master' into master
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 46b97ec..3f9223c 100644
--- a/README.md
+++ b/README.md
@@ -148,6 +148,22 @@ fmt.Printf("Fetching the following IDs from %s: %q", args.Database, args.IDs)
Fetching the following IDs from foo: [1 2 3]
```
+### Arguments that can be specified multiple times, mixed with positionals
+```go
+var args struct {
+ Commands []string `arg:"-c,separate"`
+ Files []string `arg:"-f,separate"`
+ Databases []string `arg:"positional"`
+}
+```
+
+```shell
+./example -c cmd1 db1 -f file1 db2 -c cmd2 -f file2 -f file3 db3 -c cmd3
+Commands: [cmd1 cmd2 cmd3]
+Files [file1 file2 file3]
+Databases [db1 db2 db3]
+```
+
### Custom validation
```go
var args struct {