def Args(parser):
    """Register flags for this command."""
    # Flags for specifying job refs directly
    job_utils.ArgsForJobRefs(parser, nargs='*')

    # Flags for filtering jobs.
    parser.add_argument('--job-name',
                        help='Filter the jobs to those with the given name.')
    parser.add_argument(
        '--status', action='append',
        choices=['running', 'stopped', 'done', 'cancelled', 'failed',
                 'updated'],
        help='Filter the jobs to those with the selected status')
    parser.add_argument(
        '--created-after', type=time_util.ParseTimeArg,
        help='Filter the jobs to those created after the given time')
    parser.add_argument(
        '--created-before', type=time_util.ParseTimeArg,
        help='Filter the jobs to those created before the given time')
예제 #2
0
 def Args(parser):
     """Register flags for this command."""
     job_utils.ArgsForJobRefs(parser, nargs='+')