ansible/docs/templates/cli_rst.j2
Matt Martz db6cc60352
Migrate command line parsing to argparse (#50610)
* Start of migration to argparse

* various fixes and improvements

* Linting fixes

* Test fixes

* Fix vault_password_files

* Add PrependAction for argparse

* A bunch of additional tweak/fixes

* Fix ansible-config tests

* Fix man page generation

* linting fix

* More adhoc pattern fixes

* Add changelog fragment

* Add support for argcomplete

* Enable argcomplete global completion

* Rename PrependAction to PrependListAction to better describe what it does

* Add documentation for installing and configuring argcomplete

* Address rebase issues

* Fix display encoding for vault

* Fix line length

* Address rebase issues

* Handle rebase issues

* Use mutually exclusive group instead of handling manually

* Fix rebase issues

* Address rebase issue

* Update version added for argcomplete support

* -e must be given a value

* ci_complete
2019-04-23 13:54:39 -05:00

139 lines
2.5 KiB
Django/Jinja

{% set name = cli_name -%}
{% set name_slug = cli_name -%}
.. _{{name}}:
{% set name_len = name|length + 0-%}
{{ '=' * name_len }}
{{name}}
{{ '=' * name_len }}
:strong:`{{short_desc|default('')}}`
.. contents::
:local:
:depth: 2
.. program:: {{cli_name}}
Synopsis
========
.. code-block:: bash
{{ usage|replace('%prog', cli_name) }}
Description
===========
{{ long_desc|default('', True) }}
{% if options %}
Common Options
==============
{% for option in options|sort(attribute='options') if option.options %}
.. option:: {% for switch in option['options'] %}{{switch}}{% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
{{ option['desc'] }}
{% endfor %}
{% endif %}
{% if arguments %}
ARGUMENTS
=========
.. program:: {{cli_name}}
{% for arg in arguments %}
.. option:: {{ arg }}
{{ (arguments[arg]|default(' '))}}
{% endfor %}
{% endif %}
{% if actions %}
Actions
=======
{% for action in actions %}
.. program:: {{cli_name}} {{action}}
.. _{{cli_name|replace('-','_')}}_{{action}}:
{{ action}}
{{ '-' * action|length}}
{{ (actions[action]['desc']|default(' '))}}
{% if actions[action]['options'] %}
{% for option in actions[action]['options']|sort(attribute='options') %}
.. option:: {% for switch in option['options'] if switch in actions[action]['option_names'] %}{{switch}} {% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
{{ (option['desc']) }}
{% endfor %}
{% endif %}
{% endfor %}
.. program:: {{cli_name}}
{% endif %}
Environment
===========
The following environment variables may be specified.
{% if inventory %}
:envvar:`ANSIBLE_INVENTORY` -- Override the default ansible inventory file
{% endif %}
{% if library %}
:envvar:`ANSIBLE_LIBRARY` -- Override the default ansible module library path
{% endif %}
:envvar:`ANSIBLE_CONFIG` -- Override the default ansible config file
Many more are available for most options in ansible.cfg
Files
=====
{% if inventory %}
:file:`/etc/ansible/hosts` -- Default inventory file
{% endif %}
:file:`/etc/ansible/ansible.cfg` -- Config file, used if present
:file:`~/.ansible.cfg` -- User config file, overrides the default config if present
Author
======
Ansible was originally written by Michael DeHaan.
See the `AUTHORS` file for a complete list of contributors.
Copyright
=========
Copyright © 2017 Red Hat, Inc | Ansible.
Ansible is released under the terms of the GPLv3 License.
See also
========
{% for other in cli_bin_name_list|sort %}:manpage:`{{other}}(1)`, {% endfor %}