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: command line arguments -> if empty we check environmental variables -> and then we use default values + +```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