The docs team has a utility that uses the bash-completion to generate the CLI documentation - no extra changes are required in the CLI *if* it exposes a bash-completion action. The script in question is here:
http://git.openstack.org/cgit/openstack/openstack-doc-tools/tree/os_doc_tools/commands.py
I'm in the process of changing it to accept/generate docs for the unified CLI, but it does not appear to have the required action:
$ python commands.py openstack OpenStack Auto Documenting of Commands (using openstack-doc-tools version 0.8.2)
Documenting 'openstack' Documenting 'openstack help' Documenting 'openstack' subcommands... ERROR: cliff.app Unknown command ['bash-completion'] Traceback (most recent call last): File "commands.py", line 528, in <module> sys.exit(main()) File "commands.py", line 524, in main document_single_project(prog_args.client) File "commands.py", line 491, in document_single_project subcommands) File "commands.py", line 409, in generate_subcommands "bash-completion"]).strip().split() File "commands.py", line 40, in check_output raise subprocess.CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['openstack', 'bash-completion']' returned non-zero exit status 2 $ openstack bash-completion ERROR: cliff.app Unknown command ['bash-completion']
If I run one of the traditional clients with the bash-completion argument (i.e. nova) then it spits out the expected output listing arguments etc.
Installed python-openstackclient from pip is:
$ pip show python-openstackclient --- Name: python-openstackclient Version: 0.3.0 Location: /usr/lib/python2.7/site-packages Requires: pbr, cliff, keyring, pycrypto, python-glanceclient, python-keystoneclient, python-novaclient, python-cinderclient, requests, six
The docs team has a utility that uses the bash-completion to generate the CLI documentation - no extra changes are required in the CLI *if* it exposes a bash-completion action. The script in question is here:
http:// git.openstack. org/cgit/ openstack/ openstack- doc-tools/ tree/os_ doc_tools/ commands. py
I'm in the process of changing it to accept/generate docs for the unified CLI, but it does not appear to have the required action:
$ python commands.py openstack
OpenStack Auto Documenting of Commands (using openstack-doc-tools version 0.8.2)
Documenting 'openstack' exit(main( )) single_ project( prog_args. client) single_ project subcommands completion" ]).strip( ).split( ) CalledProcessEr ror(retcode, cmd, output=output) CalledProcessEr ror: Command '['openstack', 'bash-completion']' returned non-zero exit status 2
Documenting 'openstack help'
Documenting 'openstack' subcommands...
ERROR: cliff.app Unknown command ['bash-completion']
Traceback (most recent call last):
File "commands.py", line 528, in <module>
sys.
File "commands.py", line 524, in main
document_
File "commands.py", line 491, in document_
subcommands)
File "commands.py", line 409, in generate_
"bash-
File "commands.py", line 40, in check_output
raise subprocess.
subprocess.
$ openstack bash-completion
ERROR: cliff.app Unknown command ['bash-completion']
If I run one of the traditional clients with the bash-completion argument (i.e. nova) then it spits out the expected output listing arguments etc.
Installed python- openstackclient from pip is:
$ pip show python- openstackclient openstackclient python2. 7/site- packages glanceclient, python- keystoneclient, python-novaclient, python- cinderclient, requests, six
---
Name: python-
Version: 0.3.0
Location: /usr/lib/
Requires: pbr, cliff, keyring, pycrypto, python-