示例#1
0
    def parse(self, subcommand, parser, parsed_args,
              **kwargs) -> Optional[Subcommand]:
        """
        Resolve command-line options to a Subcommand or None.

        :param subcommand: equivalent to parsed_args.command.
        :param parser: parser used.
        :param parsed_args: output of parsing.
        :param kwargs: additional args.
        :return: None or a Subcommand.
        """
        configure_resmoke.validate_and_update_config(parser, parsed_args)
        if subcommand == MULTIVERSION_SUBCOMMAND:
            return MultiversionConfigSubcommand()
        return None
示例#2
0
    def parse(self, subcommand, parser, parsed_args, **kwargs):
        """
        Return the FCV constants subcommand for execution.

        :param subcommand: equivalent to parsed_args.command
        :param parser: parser used
        :param parsed_args: output of parsing
        :param kwargs: additional args
        :return: None or a Subcommand
        """
        configure_resmoke.validate_and_update_config(parser, parsed_args)
        if subcommand != _COMMAND:
            return None

        return GenerateFCVConstants()
示例#3
0
    def parse(self, subcommand, parser, parsed_args,
              **kwargs) -> Optional[Subcommand]:
        """
        Resolve command-line options to a Subcommand or None.

        :param subcommand: equivalent to parsed_args.command.
        :param parser: parser used.
        :param parsed_args: output of parsing.
        :param kwargs: additional args.
        :return: None or a Subcommand.
        """
        configure_resmoke.validate_and_update_config(parser, parsed_args)
        if subcommand == TEST_DISCOVERY_SUBCOMMAND:
            return TestDiscoverySubcommand(parsed_args.suite)
        if subcommand == SUITECONFIG_SUBCOMMAND:
            return SuiteConfigSubcommand(parsed_args.suite)
        return None
示例#4
0
def set_run_options(argstr=''):
    """Populate the config module variables for the 'run' subcommand with the default options."""
    parser, parsed_args = parse(['run'] + shlex.split(argstr))
    configure_resmoke.validate_and_update_config(parser, parsed_args)