summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md38
1 files changed, 22 insertions, 16 deletions
diff --git a/README.md b/README.md
index 1a7377c..b3b5886 100644
--- a/README.md
+++ b/README.md
@@ -19,17 +19,6 @@ $ ./example --foo=hello --bar
hello true
```
-### Default values
-
-```go
-var args struct {
- Foo string
- Bar bool
-}
-args.Foo = "default value"
-arg.MustParse(&args)
-```
-
### Required arguments
```go
@@ -40,6 +29,12 @@ var args struct {
arg.MustParse(&args)
```
+```shell
+$ ./example
+usage: example --foo FOO [--bar]
+error: --foo is required
+```
+
### Positional arguments
```go
@@ -79,11 +74,22 @@ positional arguments:
output
options:
---verbose, -v verbosity level
---dataset DATASET dataset to use
---optimize OPTIMIZE, -O OPTIMIZE
- optimization level
---help, -h print this help message
+ --verbose, -v verbosity level
+ --dataset DATASET dataset to use
+ --optimize OPTIMIZE, -O OPTIMIZE
+ optimization level
+ --help, -h print this help message
+```
+
+### Default values
+
+```go
+var args struct {
+ Foo string
+ Bar bool
+}
+args.Foo = "default value"
+arg.MustParse(&args)
```
### Arguments with multiple values