Checks the arguments and options.
491118
def check_args(args):
    """"""
    # Checking that only VCF can have a - (stdout) as output
    if args.output_format not in _streamable_format and args.output == "-":
        logger.error("{} format cannot be streamed to standard output"
                     "".format(args.output_format))
        sys.exit(1)

    # Checking the file extensions
    if args.output_format == "vcf" and args.output != "-":
        if not args.output.endswith(".vcf"):
            args.output += ".vcf"

    elif args.output_format == "plink":
        if args.output.endswith(".bed"):
            args.output = args.output[:-4]
158425
def check(self, options=None):
        """"""
        self.check_values(options)
        self.check_attributes(options)
        self.check_values(options)
        return self
924668
protected void parseArguments(String[] arguments) {
        LinkedList<String> args = new LinkedList<String>(Arrays.asList(arguments));

        boolean valid = true;
        while (!args.isEmpty()) {
            String arg = args.removeFirst();

            boolean handled = false;
            for (Option option : options) {
                if (option.processOption(arg, args)) {
                    handled = true;
                    break;
                }
            }
            if (!handled) {
                System.out.println("Unknown option: " + arg);
                System.out.println();
                valid = false;
                break;
            }
        }
        if (!valid) {
            showOptions();
            completed();
        }
    }
701690
def _check_arguments(self):
        """"""
        if self.argument_checked:
            return

        assert(self.symbol is not None)
        self.argument_checked = True

        # check if symbol contain duplicated names.
        _check_arguments(self.symbol)
        # rematch parameters to delete useless ones
        if self.allow_extra_params:
            if self.arg_params:
                arg_names = set(self.symbol.list_arguments())
                self.arg_params = {k : v for k, v in self.arg_params.items()
                                   if k in arg_names}
            if self.aux_params:
                aux_names = set(self.symbol.list_auxiliary_states())
                self.aux_params = {k : v for k, v in self.aux_params.items()
                                   if k in aux_names}
136910
protected void checkOption(CliOptionContainer optionContainer) {

    CliOption option = optionContainer.getOption();
    String mode = option.mode();
    if (this.cliState.getMode(mode) == null) {
      handleUndefinedMode(optionContainer);
    }

    checkOptionName(option.name(), optionContainer);
    for (String alias : option.aliases()) {
      checkOptionName(alias, optionContainer);
    }
  }
445996
public static void checkOptional(OptionSet options, String opt1, String opt2) {
        List<String> opts = Lists.newArrayList();
        opts.add(opt1);
        opts.add(opt2);
        checkOptional(options, opts);
    }
720468
def check_arguments(args):
	
	projectname_re = re.compile(r'[^a-zA-Z0-9_]')
	if args['genconfig']:
		if args['--type'] not in ['scraper', 'crawler']:
			raise InvalidType("--type has to be 'scraper' or 'crawler'")
		if args['--selector'] not in ['xpath', 'css']:
			raise InvalidSelector("--selector has to be 'xpath' or 'css'")
	if args['generate'] or args['run']:
		if args['--output_type'] not in ['json', 'csv']:
			raise InvalidOutputType("--output_type has to be 'json' or 'csv'")
	if args['genconfig'] or args['generate'] or args['run']:
		if projectname_re.search(args['<projectname>']) is not None:
			message = "<projectname> should consist of letters, digits or _"
			raise InvalidProjectName(message)
	try:
		if int(args['--levels']) < 1:
			message = "--levels should be greater than, or equal to 1"
			raise InvalidLevels(message)
	except (TypeError, ValueError):
		message = " ".join([
			"--levels should be an integer and not of type",
			"{}".format(type(args['--levels']))
		])
		raise InvalidLevels(message)
1069155
function checkOptions(options) {
                // @TODO: should we throw an error if there are incorrect options provided?
                options = _.pick(options, permittedOptions);

                let validationErrors = utils.validateOptions(options);

                if (_.isEmpty(validationErrors)) {
                    return Promise.resolve(options);
                }

                // For now, we can only handle showing the first validation error
                return Promise.reject(validationErrors[0]);
            }
251319
def parse_options(self, prog_name, arguments):
        """"""
        # Don't want to load configuration to just print the version,
        # so we handle --version manually here.
        if '--version' in arguments:
            self.exit_status(self.version, fh=sys.stdout)
        parser = self.create_parser(prog_name)
        options, args = parser.parse_args(arguments)
        return options, args
630763
def arguments(self, args):
        """"""
        self.args = args
        self.manage_flags()
        self.filename = self.args[0]
        if len(self.args) == 1 and self.args[0] in self.options[:2]:
            print(self.help.__doc__)
        elif len(self.args) == 1 and self.args[0] in self.options[2:4]:
            self.version()
        elif len(self.args) == 2 and self.args[0] in self.options[4:5]:
            self.filename = self.args[1]
            self.remove()
        elif len(self.args) == 2 and self.args[0] in self.options[6:7]:
            self.filename = self.args[1]
            self.remove()
        elif len(self.args) == 1:
            if os.path.isfile(self.args[0]):
                self.remove()
            else:
                self.not_access()
        else:
            self.usage()
855536
def valid_options(kwargs, allowed_options):
    

    diff = set(kwargs) - set(allowed_options)
    if diff:
        print("Invalid option(s): ", ', '.join(diff))
        return False
    return True
671169
def args(self):
        """"""
        if self._args is None:
            parser = self._build_parser()
            self._args = parser.parse_args()
        return self._args
1131893
def _check_arg(self, arg):
        
        if isinstance(arg, list):
            return self._get_dependencies_from_args(arg)
        elif isinstance(arg, dict):
            return self._get_dependencies_from_kwargs(arg)

        if not is_dependency_name(arg):
            return set()
        return set([arg[1:]])
766075
function checkArguments(node) {
            const args = node.arguments;

            switch (args.length) {
                case 0:
                    context.report({
                        node,
                        message: "Missing parameters."
                    });
                    break;

                case 1:
                    if (mode === MODE_ALWAYS) {
                        context.report({
                            node,
                            message: "Missing radix parameter."
                        });
                    }
                    break;

                default:
                    if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) {
                        context.report({
                            node,
                            message: "Redundant radix parameter."
                        });
                    } else if (!isValidRadix(args[1])) {
                        context.report({
                            node,
                            message: "Invalid radix parameter."
                        });
                    }
                    break;
            }
        }
94375
static void checkArgument(boolean check, String msg, Object... args) {
    if (!check) {
      throw new IllegalArgumentException(String.format(msg, args));
    }
  }
1313424
def check_arguments(self):
        """"""
        for name, default in self.argdict.items():
            if name not in self.names and default is NODEFAULT:
                raise NameError('Missing argparse specification for %r' % name)
1123274
def check_arguments(self):
        
        for k, v in self.Parameters.iteritems():
            if self.Parameters[k].isOn():
                if k in self._valid_arguments:
                    if not self._valid_arguments[k](v.Value):
                        error_message = 'Invalid argument (%s) ' % v.Value
                        error_message += 'for parameter %s\n' % k
                        raise InvalidArgumentApplicationError(error_message)