
                             S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  S
r " S S\R                  5      rg)zAA calliope command that prints help for another calliope command.    )absolute_import)division)unicode_literalsN)base)search)search_util)log   c                   L    \ rS rSrSr\R                  r\S 5       r	S r
S rSrg)Help!   ak  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                    U R                   R                  [        R                  " 5       5        U R                   R	                  S5        [
        R                  R                  U 5        [
        R                  R                  U [        5        [
        R                  R                  U S5        U R                  SSSS9  U R                  S[        R                  SS9  g )	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Args	Help.ArgsO   s    
%%k&?&?&AB
!! # 
 	MM""6*OOv~6  6
  
   
      c                 t   UR                   (       d!   U R                  UR                  S/-   5        g [        R
                  " UR                  UR                   =(       d    / -   U R                  5      n[        U5      U l        [        [        U5      UR                  5      U l        U$ ! [         a     Nf = f)Nz--document=style=help)r   ExecuteCommandDoNotUser   	Exceptionr   	RunSearch_cli_power_users_onlylen_resources_foundminlimit_resources_displayed)selfargsresultss      r"   RunHelp.Runu   s     	##DLL4K3L$LM
 ))/R0""$G  LD #CL$** =DN  s   B* *
B76B7c                     U R                   (       d  g U(       aD  [        R                  R                  SR	                  U R
                  U R                   5      5        g [        R                  R                  S5        g )NzListed {} of {} items.zListed 0 items.)r,   r	   statusPrintformatr/   )r0   resources_were_displayeds     r"   EpilogHelp.Epilog   sY      	jj
"
)
)$*C*C*.*?*?AB 
jj()r%   )r/   r,   N)__name__
__module____qualname____firstlineno____doc__r   SDK_TOOLS_CATEGORYcategorystaticmethodr#   r3   r:   __static_attributes__ r%   r"   r   r   !   s2    )V $$(# #J&*r%   r   )r@   
__future__r   r   r   r   googlecloudsdk.callioper   &googlecloudsdk.command_lib.help_searchr   r   googlecloudsdk.corer	   r   ListCommandr   rE   r%   r"   <module>rK      s>     H &  '  ( 9 > # o*4 o*r%   