File: //lib/google-cloud-sdk/lib/surface/__pycache__/help.cpython-312.pyc
�
��� � � � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z ddlm
Z
dd lmZ d
Z
G d� dej � Zy)
zAA calliope command that prints help for another calliope command.� )�absolute_import)�division)�unicode_literalsN)�base)�search)�search_util)�log� c �D � e Zd ZdZej
Zed� � Zd� Z d� Z
y)�Helpa� Search gcloud help text.
If a full gcloud command is specified after the ``help'' operand, {command}
prints a detailed help message for that command.
Otherwise, {command} runs a search for all commands with help text matching
the given argument or arguments. It prints the command name and a summary of
the help text for any command that it finds as a result.
To run a search directly, you can use remainder arguments, following a `--`.
By default, command results are displayed in a table that shows the name
of the command and snippets of the help text that relate to your search terms.
By default, search results are sorted from most to least relevant by default,
using a localized rating based on several heuristics. These heuristics may
change in future runs of this command.
## EXAMPLES
To get the help for the command `gcloud projects describe`, run:
$ {command} projects describe
To search for all commands whose help text contains the word `project`, run:
$ {command} -- project
To search for commands whose help text contains the word `project` and the
string `--foo`, run:
$ {command} -- project --foo
To search and receive more than the default limit of 5 search results, run:
$ {command} --limit=20 -- project
To search for a term and sort the results by a different characteristic, such
as command name, run:
$ {command} --sort-by=name -- project
c �� � | j j t j � � | j j d� t
j j | � t
j j | t � t
j j | d� | j ddd�� | j dt j d�� y ) Nzn
table[all-box,pager](
commandpath():label='COMMAND',
summary():wrap)
z
~relevance�command�*a Sequence of names representing a gcloud group or command name.
If the arguments provide the name of a gcloud command, the full help
text of that command will be displayed. Otherwise, all arguments will
be considered search terms and used to search through all of gcloud's
help text.
)�nargs�help�search_termsan Search terms. The command will return a list of gcloud commands that are
relevant to the searched term. If this argument is provided, the command
will always return a list of search results rather than displaying help
text of a single command.
For example, to search for commands that relate to the term `project` or
`folder`, run:
$ {command} -- project folder
)�display_info�
AddTransformsr �
GetTransforms� AddFormatr �URI_FLAG�RemoveFromParser�
LIMIT_FLAG�
SetDefault�_DEFAULT_LIMIT�SORT_BY_FLAG�add_argument�argparse� REMAINDER)�parsers �lib/surface/help.py�Argsz Help.ArgsO s� � �
���%�%�k�&?�&?�&A�B�
���!�!� #�
�
�M�M�"�"�6�*��O�O���v�~�6���� � ���6�
������ �
� ����� � �
� �
� c �\ � |j s! | j |j dgz � y t j
|j |j xs g z | j � }t |� | _ t t |� |j � | _ |S # t $ r Y �|w xY w)Nz--document=style=help)r �ExecuteCommandDoNotUser � Exceptionr � RunSearch�_cli_power_users_only�len�_resources_found�min�limit�_resources_displayed)�self�args�resultss r! �RunzHelp.Runu s� � ����
�
�#�#�D�L�L�4K�3L�$L�M��
�������)�)�/�R�0��"�"�$�G� ��L�D�� #�C��L�$�*�*� =�D���N�� �
��
�s �B � B+�*B+c �� � | j sy |rDt j j dj | j
| j � � y t j j d� y )NzListed {} of {} items.zListed 0 items.)r* r �status�Print�formatr- )r. �resources_were_displayeds r! �EpilogzHelp.Epilog� sY � �� � ��� �j�j���
"�
)�
)�$�*C�*C�*.�*?�*?�A�B�
�j�j���(�)r# N)�__name__�
__module__�__qualname__�__doc__r �SDK_TOOLS_CATEGORY�category�staticmethodr"