Пример #1
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
          to capture some information, but behaves like an ArgumentParser.
    """
        parser.add_argument('--show-occurrences',
                            action='store_true',
                            default=False,
                            help=argparse.SUPPRESS)
        parser.add_argument('--occurrence-filter',
                            default=' OR '.join([
                                'kind = "{kind}"'.format(kind=x)
                                for x in _DEFAULT_KINDS
                            ]),
                            help=argparse.SUPPRESS)
        parser.add_argument('--show-occurrences-from',
                            type=arg_parsers.BoundedInt(1,
                                                        sys.maxint,
                                                        unlimited=True),
                            default=_DEFAULT_SHOW_OCCURRENCES_FROM,
                            help=argparse.SUPPRESS)
        flags.AddImagePositional(parser, verb='list tags for')
        # Set flag defaults to return X most recent images instead of all.
        base.LIMIT_FLAG.SetDefault(parser, _DEFAULT_LIMIT)
        base.SORT_BY_FLAG.SetDefault(parser, _DEFAULT_SORT_BY)

        # Does nothing for us, included in base.ListCommand
        base.URI_FLAG.RemoveFromParser(parser)
        parser.display_info.AddFormat(_TAGS_FORMAT)
Пример #2
0
    def Args(parser):
        """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
        to capture some information, but behaves like an ArgumentParser.
    """
        flags.AddImagePositional(parser, verb='list tags for')
        base.SORT_BY_FLAG.SetDefault(parser, _DEFAULT_SORT_BY)

        # Does nothing for us, included in base.ListCommand
        base.URI_FLAG.RemoveFromParser(parser)
        parser.display_info.AddFormat(_TAGS_FORMAT)