summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 229a9df..855c02e 100644
--- a/README.md
+++ b/README.md
@@ -158,6 +158,19 @@ var args struct {
arg.MustParse(&args)
```
+### Priority
+
+You can use both command line arguments and environmental variables at the same time.
+The priority is as follows: <b>command line arguments</b> -> if empty we check <b>environmental variables</b> -> and then we use <b>default values</b>
+
+```go
+var args struct {
+ Command string `arg:"-c,env:COMMAND" help:"Command to execute" default:"remove"`
+ File string `arg:"-f,env:FILE_NAME"`
+}
+arg.MustParse(&args)
+```
+
### Default values (before v1.2)
```go