You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, the *CLI argument*`name` will have a default value of `"World"`, but will also read any value passed to the environment variable `AWESOME_NAME` if no value is provided in the command line:
36
16
@@ -75,27 +55,7 @@ Hello Mr. Czernobog
75
55
76
56
You are not restricted to a single environment variable, you can declare a list of environment variables that could be used to get a value if it was not passed in the command line:
And it will be used in the automatic `--help` option:
40
18
@@ -59,27 +37,7 @@ Options:
59
37
60
38
And of course, you can also combine that `help` with the <abbrtitle="a multi-line string as the first expression inside a function (not assigned to any variable) used for documentation">docstring</abbr>:
@@ -271,27 +169,7 @@ But you can customize it with the `metavar` parameter for `typer.Argument()`.
271
169
272
170
For example, let's say you don't want to have the default of `NAME`, you want to have `username`, in lowercase, and you really want ✨ emojis ✨ everywhere:
Now the generated help text will have `✨username✨` instead of `NAME`:
297
175
@@ -317,27 +195,7 @@ You might want to show the help information for *CLI arguments* in different pan
317
195
318
196
If you have installed Rich as described in the docs for [Printing and Colors](../printing.md){.internal-link target=_blank}, you can set the `rich_help_panel` parameter to the name of the panel where you want this *CLI argument* to be shown:
Then, if you check the `--help` option, you will see a default panel named "`Arguments`" for the *CLI arguments* that don't have a custom `rich_help_panel`.
343
201
@@ -380,27 +238,7 @@ If you want, you can make a *CLI argument* **not** show up in the `Arguments` se
380
238
381
239
You will probably not want to do this normally, but it's possible:
0 commit comments