feat: support multiple env variables (#349)

This commit is contained in:
Denis Titusov
2023-01-31 22:39:30 +03:00
committed by GitHub
parent 37e801405f
commit 9610ed62d9
11 changed files with 149 additions and 35 deletions
+2 -2
View File
@@ -522,10 +522,10 @@ Tags can be in two forms:
Both can coexist with standard Tag parsing.
| Tag | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cmd:""` | If present, struct is a command. |
| `arg:""` | If present, field is an argument. Required by default. |
| `env:"X"` | Specify envar to use for default value. |
| `env:"X,Y,..."` | Specify envars to use for default value. The envs are resolved in the declared order. The first value found is used. |
| `name:"X"` | Long name, for overriding field name. |
| `help:"X"` | Help text. |
| `type:"X"` | Specify [named types](#custom-named-decoders) to use. |