Grouping CLI Options #794
-
First Check
Commit to Help
Example Codenetcfgbu backup --help
Usage: netcfgbu backup [OPTIONS]
Test logins to network devices, and reports the credential username that was used.
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --config -C TEXT NETCFGBU Config File. [env var: NETCFGBU_CONFIG] [default: netcfgbu.toml] │
│ --inventory -i TEXT NETCFGBU Inventory File. [env var: NETCFGBU_INVENTORY] [default: inventory.csv] │
│ --exclude -e TEXT Exclude from inventory. [default: None] │
│ --limit -l TEXT Limit/Include in inventory. [default: None] │
│ --batch -b INTEGER Inventory record processing batch size. [default: 100] │
│ --help Show this message and exit. │
│ │
│ --default_username -du TEXT Default username to login with. [env var: NETCFGBU_DEFAULT_USERNAME] [default: None] │
│ --default_password -dp TEXT Default password to login with [env var: NETCFGBU_DEFAULT_PASSWORD] [default: None] │
│ --configs_dir -cd TEXT Location to backup device configs to. [env var: NETCFGBU_CONFIGSDIR] [default: configs] │
│ --plugins_dir -pd TEXT Location where plugins reside. [env var: NETCFGBU_PLUGINSSDIR] [default: plugins] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯DescriptionIs there anyway to group cli options together in a manner sort of like the bash output I attached? I'd like a way to separate out less common options to prevent cli input overload. I'd even be happy to deal separate out non-required options. I am search for ways to do this, and I am at a loss. Apologies if it's obvious or clearly not an option. As always thanks for everything! Operating SystemLinux, Windows, macOS Operating System DetailsNo response Typer Version0.12.1 Python VersionPython 3.9.18 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
How did you override the default Usage: message? |
Beta Was this translation helpful? Give feedback.
-
|
Seems like this is what you need: https://typer.tiangolo.com/tutorial/commands/help/#help-panels-for-cli-parameters |
Beta Was this translation helpful? Give feedback.
Seems like this is what you need: https://typer.tiangolo.com/tutorial/commands/help/#help-panels-for-cli-parameters