Skip to content

Commit

Permalink
Updated docs templates (snowflakedb#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Sep 7, 2023
1 parent a692b7e commit a53d7f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/snowcli/app/dev/docs/templates/overview.rst.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
Global options
===============================================================================
{% for param in options if not param.hidden %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %}{% if not param.is_flag %} <{{ param.name }}>{% endif %}`
{% if param.help %}{{ param.help }}{% else %}TBD{% endif %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %}{% if not param.is_flag %} {{ '{' }}{{ param.name }}{{ '}' }}{% endif %}`
{% if param.help %}{{ " " + param.help }}{% if param.help[-1] != '.' %}.{% endif %}{% else %} TBD{% endif %}
{% endfor %}
22 changes: 17 additions & 5 deletions src/snowcli/app/dev/docs/templates/usage.rst.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,31 @@ Syntax

.. code-block:: console

snow {% for part in path %}{{ part }}{{ " " if not loop.last }}{% endfor %} {% if options %}[OPTIONS]{% endif %} {% for param in arguments %}{{ param.name | upper }}{{ " " if not loop.last }}{% endfor %}
snow {% for part in path %}{{ part }}{{ " " if not loop.last }}{% endfor %}
{%- for param in options if not param.hidden %}
{{ " " + param.opts[-1] }}{% if not param.is_flag %} <{{ param.name }}>{% endif %}
{%- endfor %}

Arguments
===============================================================================

{%- if arguments %}
{% for param in arguments %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %} <{{ param.name }}>`
{% if param.help %}{{ param.help }}{% else %}TBD{% endif %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %} {{ '{' }}{{ param.name }}{{ '}' }}`
{% if param.help %}{{ " " + param.help }}{% if param.help[-1] != '.' %}.{% endif %}{% else %} TBD{% endif %}
{% endfor %}
{% else %}

None

{% endif -%}

Options
===============================================================================

{%- if options %}
{% for param in options if not param.hidden %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %}{% if not param.is_flag %} <{{ param.name }}>{% endif %}`
{% if param.help %}{{ param.help }}{% else %}TBD{% endif %}
:samp:`{% for p in param.opts %}{{ p }}{{ ", " if not loop.last }}{% endfor %}{% if not param.is_flag %} {{ '{' }}{{ param.name }}{{ '}' }}{% endif %}`
{% if param.help %}{{ " " + param.help }}{% if param.help[-1] != '.' %}.{% endif %}{% else %} TBD{% endif %}
{% endfor %}
{%- else %}None{% endif %}

0 comments on commit a53d7f3

Please sign in to comment.