Ejemplo n.º 1
0
def setup_command_args(parser):
    """Sets up command 'list_checks' and 'check_compat'."""

    # Command 'list_checks'.
    list_check_parser = parser.add_parser(
        'list_checks', help='lists all possible check items. Run')
    list_check_parser.set_defaults(func=do_list_checks)

    # command 'check_compat'
    check_compat_parser = parser.add_parser(
        'check_compat',
        help='checks compatibility between a system and a vendor',
        description=_CHECK_COMPAT_DESC,
        formatter_class=argparse.RawTextHelpFormatter)
    check_compat_parser.add_argument('-s',
                                     '--only-summary',
                                     action='store_true',
                                     help='only output the summary result')
    image_sources.add_argument_group(check_compat_parser,
                                     required_images=['system', 'vendor'])
    check_compat_parser.add_argument(
        'CHECK_ITEM',
        type=str,
        nargs='*',
        help=('the check item to be performed\n'
              'select one from: {}\n'.format(
                  _format_check_list(checker.Checker.get_all_check_list())) +
              'if not given, it will check all'))
    check_compat_parser.set_defaults(func=do_check_compat)
Ejemplo n.º 2
0
def setup_command_args(parser):
  """Sets up command 'list_checks' and 'check_compat'."""

  # Command 'list_checks'.
  list_check_parser = parser.add_parser(
      'list_checks', help='lists all possible check items. Run')
  list_check_parser.set_defaults(func=do_list_checks)

  # command 'check_compat'
  check_compat_parser = parser.add_parser(
      'check_compat',
      help='checks compatibility between a system and a vendor',
      description=_CHECK_COMPAT_DESC,
      formatter_class=argparse.RawTextHelpFormatter)
  check_compat_parser.add_argument(
      '-s',
      '--only-summary',
      action='store_true',
      help='only output the summary result')
  image_sources.add_argument_group(
      check_compat_parser,
      required_images=['system', 'vendor'])
  check_compat_parser.add_argument(
      'CHECK_ITEM',
      type=str,
      nargs='*',
      help=('the check item to be performed\n'
            'select one from: {}\n'.format(_format_check_list(
                checker.Checker.get_all_check_list())) +
            'if not given, it will check all'))
  check_compat_parser.set_defaults(func=do_check_compat)
Ejemplo n.º 3
0
def setup_command_args(parser):
    """Setup command 'list_check' and 'check_compat'."""

    # command 'list_check'
    list_check_parser = parser.add_parser(
        'list_check', help='list all possible checking IDs')
    list_check_parser.set_defaults(func=do_list_check)

    # command 'check_compat'
    check_compat_parser = parser.add_parser(
        'check_compat',
        help='checks compatibility between a system and a vendor',
        description=_CHECK_COMPAT_DESC,
        formatter_class=argparse.RawTextHelpFormatter)
    check_compat_parser.add_argument('-s',
                                     '--only-summary',
                                     action='store_true',
                                     help='only output the summary result')
    image_sources.add_argument_group(check_compat_parser,
                                     required_system=True,
                                     required_vendor=True)
    check_compat_parser.add_argument(
        'ID',
        type=str,
        nargs='*',
        help='the checking ID to be dumped. Check all if not given')
    check_compat_parser.set_defaults(func=do_check_compat)
Ejemplo n.º 4
0
def setup_command_args(parser):
  # command 'pull'
  pull_parser = parser.add_parser(
      'pull',
      help='pull a file from the given image',
      description=_PULL_DESCRIPTION,
      formatter_class=argparse.RawTextHelpFormatter)
  image_sources.add_argument_group(pull_parser)
  pull_parser.add_argument(
      'SOURCE',
      type=str,
      help='the full path file name in given image to be pull')
  pull_parser.add_argument(
      'DEST',
      nargs='?',
      default='.',
      type=str,
      help='the file name or directory to save the pulled file (default: .)')
  pull_parser.set_defaults(func=do_pull)
Ejemplo n.º 5
0
def setup_command_args(parser):
    # command 'pull'
    pull_parser = parser.add_parser(
        'pull',
        help='pull a file from the given image',
        description=_PULL_DESCRIPTION,
        formatter_class=argparse.RawTextHelpFormatter)
    image_sources.add_argument_group(pull_parser)
    pull_parser.add_argument(
        'SOURCE',
        type=str,
        help='the full path file name in given image to be pull')
    pull_parser.add_argument(
        'DEST',
        nargs='?',
        default='.',
        type=str,
        help='the file name or directory to save the pulled file (default: .)')
    pull_parser.set_defaults(func=do_pull)
Ejemplo n.º 6
0
def setup_command_args(parser):
    # command 'list_dump'
    list_dump_parser = parser.add_parser('list_dump',
                                         help='list all possible info names')
    list_dump_parser.set_defaults(func=do_list_dump)

    # command 'dump'
    dump_parser = parser.add_parser(
        'dump',
        help='dump information from given image',
        description=_DUMP_DESCRIPTION,
        formatter_class=argparse.RawTextHelpFormatter)
    dump_parser.add_argument(
        '-u',
        '--show-unknown',
        action='store_true',
        help='force display the dump info items in list which does not exist')
    image_sources.add_argument_group(dump_parser)
    dump_parser.add_argument(
        'INFO_NAME',
        type=str,
        nargs='*',
        help='the info name to be dumped. Dump all if not given')
    dump_parser.set_defaults(func=do_dump)