Exemple #1
0
    def Args(parser):
        parser.display_info.AddTransforms(search_util.GetTransforms())
        parser.display_info.AddFormat("""
        table[all-box,pager](
            commandpath():label='COMMAND',
            summary():wrap)
        """)
        base.URI_FLAG.RemoveFromParser(parser)
        base.LIMIT_FLAG.SetDefault(parser, _DEFAULT_LIMIT)
        base.SORT_BY_FLAG.SetDefault(parser, '~relevance')
        parser.add_argument('command',
                            nargs='*',
                            help="""\
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.
""")

        parser.add_argument('search_terms',
                            nargs=argparse.REMAINDER,
                            help="""\
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
""")
Exemple #2
0
 def Args(parser):
   parser.display_info.AddTransforms(search_util.GetTransforms())
   parser.display_info.AddFormat("""
       table[all-box](
           commandpath():label='COMMAND',
           summary():wrap)
       """)
   parser.add_argument('term',
                       help=('Term to search for.'))
   base.URI_FLAG.RemoveFromParser(parser)
   base.LIMIT_FLAG.SetDefault(parser, 5)
   base.SORT_BY_FLAG.SetDefault(parser, '~relevance')