I think to show related marks is enough. If user uses the marked commands or options, and they does not work, he should understand it by quantum ext-list command and get to know server does not support the extension. Let quantum Cli connect
to server is a solution, but to show different help information in different kind of situation seemingly makes thing complex and sometimes confusing.
THe marks should look like below (see [ext. xxx] after commands or options]:
gongysh@gongysh-laptop:~$ quantum -h
usage: quantum [--version] [-v] [-q] [-h] [--debug] [--os-auth-strategy <auth-strategy>] [--os-auth-url <auth-url>] [--os-tenant-name <auth-tenant-name>] [--os-username <auth-username>] [--os-password <auth-password>] [--os-region-name <auth-region-name>] [--os-token <token>] [--os-url <url>]
Command-line interface to the Quantum APIs
optional arguments:
--version show program's version number and exit
-v, --verbose Increase verbosity of output. Can be repeated.
-q, --quiet suppress output except warnings and errors
-h, --help show this help message and exit
--debug show tracebacks on errors
--os-auth-strategy <auth-strategy> Authentication strategy (Env: OS_AUTH_STRATEGY, default keystone). For now, any other value will disable the authentication
--os-auth-url <auth-url> Authentication URL (Env: OS_AUTH_URL)
--os-tenant-name <auth-tenant-name> Authentication tenant name (Env: OS_TENANT_NAME)
--os-username <auth-username> Authentication username (Env: OS_USERNAME)
--os-password <auth-password> Authentication password (Env: OS_PASSWORD)
--os-region-name <auth-region-name> Authentication region name (Env: OS_REGION_NAME)
--os-token <token> Defaults to env[OS_TOKEN]
--os-url <url> Defaults to env[OS_URL]
Commands for API v2.0:
ext-list List all exts.
ext-show Show information of a given resource
floatingip-associate Create a mapping between a floating ip and a fixed ip. [ext. router]
floatingip-create Create a floating ip for a given tenant. [ext. router]
floatingip-delete Delete a given floating ip. [ext. router]
floatingip-disassociate Remove a mapping from a floating ip to a fixed ip. [ext. router]
floatingip-list List floating ips that belong to a given tenant. [ext. router]
floatingip-show Show information of a given floating ip. [ext. router]
help print detailed help for another command
l3-agent-add-router Add a router to a L3 agent. [ext. router]
l3-agent-list List L3 agents hosting a router. [ext. router]
l3-agent-remove-router Remove a router from a L3 agent. [ext. router]
net-create Create a network for a given tenant.
net-delete Delete a given network.
net-dhcp-agent-list List the networks on a DHCP agent.
net-external-list List external networks that belong to a given tenant
net-list List networks that belong to a given tenant.
net-show Show information of a given network.
net-update Update network's information.
port-create Create a port for a given tenant.
port-delete Delete a given port.
port-list List ports that belong to a given tenant.
port-show Show information of a given port.
port-update Update port's information.
quota-delete Delete defined quotas of a given tenant. [ext. quota]
quota-list List defined quotas of all tenants. [ext. quota]
quota-show Show quotas of a given tenant [ext. quota]
quota-update Define tenant's quotas not to use defaults. [ext. quota]
For options, if this option is not from the extension (if any) which provides its command, we add mark too:
gongysh@gongysh-laptop:~$ quantum port-create -h
usage: quantum port-create [-h] [-f {html,json,shell,table,yaml}] [-c COLUMN] [--variable VARIABLE] [--prefix PREFIX] [--request-format {json,xml}] [--tenant-id tenant-id] [--name NAME] [--admin-state-down] [--mac-address MAC_ADDRESS] [--device-id DEVICE_ID] [--fixed-ip FIXED_IP] [--security-group SECURITY_GROUP] network ...
Create a port for a given tenant.
positional arguments:
network Network id or name this port belongs to
value_specs new values for the port: --key1 [type=int|bool|...] value [--key2 [type=int|bool|...] value ...]
optional arguments:
-h, --help show this help message and exit
--request-format {json,xml} the xml or json request format
--tenant-id tenant-id the owner tenant ID
--name NAME name of this port
--admin-state-down set admin state up to false
--mac-address MAC_ADDRESS mac address of this port
--device-id DEVICE_ID device id of this port
--security-group SECURITY_GROUP [ext. security-group]
I think to show related marks is enough. If user uses the marked commands or options, and they does not work, he should understand it by quantum ext-list command and get to know server does not support the extension. Let quantum Cli connect
to server is a solution, but to show different help information in different kind of situation seemingly makes thing complex and sometimes confusing.
THe marks should look like below (see [ext. xxx] after commands or options]: gongysh- laptop: ~$ quantum -h
[--os- auth-strategy <auth-strategy>] [--os-auth-url <auth-url>]
[--os- tenant- name <auth-tenant-name>]
[--os- username <auth-username>] [--os-password <auth-password>]
[--os- region- name <auth-region-name>] [--os-token <token>]
[--os- url <url>]
gongysh@
usage: quantum [--version] [-v] [-q] [-h] [--debug]
Command-line interface to the Quantum APIs
optional arguments: auth-strategy <auth-strategy>
Authenticati on strategy (Env: OS_AUTH_STRATEGY,
default keystone). For now, any other value will
disable the authentication
Authenticati on URL (Env: OS_AUTH_URL)
Authenticati on tenant name (Env: OS_TENANT_NAME)
Authenticati on username (Env: OS_USERNAME)
Authenticati on password (Env: OS_PASSWORD)
Authenticati on region name (Env: OS_REGION_NAME)
--version show program's version number and exit
-v, --verbose Increase verbosity of output. Can be repeated.
-q, --quiet suppress output except warnings and errors
-h, --help show this help message and exit
--debug show tracebacks on errors
--os-
--os-auth-url <auth-url>
--os-tenant-name <auth-tenant-name>
--os-username <auth-username>
--os-password <auth-password>
--os-region-name <auth-region-name>
--os-token <token> Defaults to env[OS_TOKEN]
--os-url <url> Defaults to env[OS_URL]
Commands for API v2.0: associate Create a mapping between a floating ip and a fixed ip. [ext. router] disassociate Remove a mapping from a floating ip to a fixed ip. [ext. router] add-router Add a router to a L3 agent. [ext. router] remove- router Remove a router from a L3 agent. [ext. router] agent-list List the networks on a DHCP agent.
ext-list List all exts.
ext-show Show information of a given resource
floatingip-
floatingip-create Create a floating ip for a given tenant. [ext. router]
floatingip-delete Delete a given floating ip. [ext. router]
floatingip-
floatingip-list List floating ips that belong to a given tenant. [ext. router]
floatingip-show Show information of a given floating ip. [ext. router]
help print detailed help for another command
l3-agent-
l3-agent-list List L3 agents hosting a router. [ext. router]
l3-agent-
net-create Create a network for a given tenant.
net-delete Delete a given network.
net-dhcp-
net-external-list List external networks that belong to a given tenant
net-list List networks that belong to a given tenant.
net-show Show information of a given network.
net-update Update network's information.
port-create Create a port for a given tenant.
port-delete Delete a given port.
port-list List ports that belong to a given tenant.
port-show Show information of a given port.
port-update Update port's information.
quota-delete Delete defined quotas of a given tenant. [ext. quota]
quota-list List defined quotas of all tenants. [ext. quota]
quota-show Show quotas of a given tenant [ext. quota]
quota-update Define tenant's quotas not to use defaults. [ext. quota]
For options, if this option is not from the extension (if any) which provides its command, we add mark too: gongysh- laptop: ~$ quantum port-create -h shell,table, yaml}] [-c COLUMN]
[ --variable VARIABLE] [--prefix PREFIX]
[ --request- format {json,xml}]
[ --tenant- id tenant-id] [--name NAME]
[ --admin- state-down] [--mac-address MAC_ADDRESS]
[ --device- id DEVICE_ID] [--fixed-ip FIXED_IP] [--security-group SECURITY_GROUP]
network ...
gongysh@
usage: quantum port-create [-h] [-f {html,json,
Create a port for a given tenant.
positional arguments:
value [--key2 [type=int|bool|...] value ...]
network Network id or name this port belongs to
value_specs new values for the port: --key1 [type=int|bool|...]
optional arguments:
the xml or json request format
the owner tenant ID state-down set admin state up to false
mac address of this port
device id of this port
[ext. security-group]
-h, --help show this help message and exit
--request-format {json,xml}
--tenant-id tenant-id
--name NAME name of this port
--admin-
--mac-address MAC_ADDRESS
--device-id DEVICE_ID
--security-group SECURITY_GROUP
....