Add options to command line.
328042
def options(self, parser, env):
        
        Plugin.options(self, parser, env)
        parser.add_option('--xcoverage-file', action='store',
                          default=env.get('NOSE_XCOVER_FILE', 'coverage.xml'),
                          dest='xcoverage_file',
                          metavar="FILE",
                          help='Path to xml coverage report.'
                          'Default is coverage.xml in the working directory. '
                          '[NOSE_XCOVERAGE_FILE]')
        parser.add_option('--xcoverage-to-stdout', action='store',
                          default=env.get('NOSE_XCOVER_TO_STDOUT', True),
                          dest='xcoverage_to_stdout',
                          help='Print coverage information to stdout.'
                          'Default is True (output coverage information to stdout). '
                          '[NOSE_XCOVER_TO_STDOUT]')
315464
def add_options(self):
        
        super(AdminTool, self).add_options()

        self.add_bool_option("--create-config",
            help="create default configuration")
        self.add_bool_option("--remove-all-rc-files",
            help="write new versions of BOTH .rc and .rc.default files, and remove stale ones")
        self.add_bool_option("--dump-config",
            help="pretty-print configuration including all defaults")
        self.add_value_option("--create-import", "GLOB-PATTERN",
            action="append", default=[],
            help="create import file for a '.d' directory")
        self.add_bool_option("--dump-rc",
            help="pretty-print dynamic commands defined in 'rtorrent.rc'")
        self.add_value_option("-o", "--output", "KEY,KEY1.KEY2=DEFAULT,...",
            action="append", default=[],
            help="select fields to print, output is separated by TABs;"
                 " default values can be provided after the key")
        self.add_bool_option("--reveal",
            help="show config internals and full announce URL including keys")
        self.add_bool_option("--screenlet",
            help="create screenlet stub")
287644
def setup_options(opts):
    ''''''
    if opts.quiet:
        logger.log.setLevel(logging.WARNING)
        logger.GLOBAL_LOG_LEVEL = logging.WARNING

    if opts.verbose:
        logger.log.setLevel(logging.DEBUG)
        logger.GLOBAL_LOG_LEVEL = logging.DEBUG
1115555
def add_arguments(self, parser):
        """"""
        # Add the underlying test command arguments first
        test_command = TestCommand()
        test_command.add_arguments(parser)

        for option in OPTIONS:
            parser.add_argument(*option[0], **option[1])
1365393
def add_args():
    """"""
    parser = argparse.ArgumentParser()

    parser.add_argument('-host', action='store', dest='host', default='127.0.0.1', help='DEFAULT "127.0.0.1"')
    parser.add_argument('-port', action='store', dest='port', default='2947', help='DEFAULT 2947', type=int)
    parser.add_argument('-json', dest='gpsd_protocol', const='json', action='store_const', default='json', help='DEFAULT JSON objects */')
    parser.add_argument('-device', dest='devicepath', action='store', help='alternate devicepath e.g.,"-device /dev/ttyUSB4"')
    # Infrequently used options
    parser.add_argument('-nmea', dest='gpsd_protocol', const='nmea', action='store_const', help='*/ output in NMEA */')
    # parser.add_argument('-rare', dest='gpsd_protocol', const='rare', action='store_const', help='*/ output of packets in hex */')
    # parser.add_argument('-raw', dest='gpsd_protocol', const='raw', action='store_const', help='*/ output of raw packets */')
    # parser.add_argument('-scaled', dest='gpsd_protocol', const='scaled', action='store_const', help='*/ scale output to floats */')
    # parser.add_argument('-timing', dest='gpsd_protocol', const='timing', action='store_const', help='*/ timing information */')
    # parser.add_argument('-split24', dest='gpsd_protocol', const='split24', action='store_const', help='*/ split AIS Type 24s */')
    # parser.add_argument('-pps', dest='gpsd_protocol', const='pps', action='store_const', help='*/ enable PPS JSON */')
    parser.add_argument('-v', '--version', action='version', version='Version: {}'.format(__version__))
    cli_args = parser.parse_args()
    return cli_args
913481
def add_raw_arg(self, arg):
        
        if not isinstance(arg, File):
            arg = str(arg)

        self._raw_options += [arg]
1217683
protected void addOptions(final List<String> command) {
        command.addAll(createOption("-c", connection));
        command.addAll(createOption("-f", forks));
        command.addAll(createOption("-i", inventory));
        command.addAll(createOption("-l", limit));
        command.addAll(createOption("-M", modulePath));
        command.addAll(createOption("--private-key", privateKey));
        command.addAll(createOption("-T", timeout));
        command.addAll(createOption("-u", remoteUser));
        command.addAll(createOption("--vault-password-file", vaultPasswordFile));
    }
1246683
private void addOptions() {

        argOptions.addOption('p', "printSimilarity",
                             "whether to print the similarity score " +
                             "(default: false)",
                             false, null, "Program Options");
        // dj: current unsupported; will be next release
        //         argOptions.addOption('s', "similarityFunction",
        //                              "name of a similarity function (default: cosine)",
        //                              true, "String", "Program Options");
        argOptions.addOption('n', "numSimilar", "the number of similar words " +
                             "to print (default: 10)", true, "String", 
                             "Program Options");
        argOptions.addOption('t', "threads", "the number of threads to use" +
                             " (default: #procesors)", true, "int", 
                             "Program Options");
        argOptions.addOption('w', "overwrite", "specifies whether to " +
                             "overwrite the existing output (default: true)",
                             true, "boolean", "Program Options");
        argOptions.addOption('v', "verbose", "prints verbose output "+ 
                             "(default: false)", false, null, 
                             "Program Options");
    }
1021297
def command_line_options(command_line_arguments):
  """"""

  # set up command line parser
  parser = argparse.ArgumentParser(description=__doc__,
      formatter_class=argparse.ArgumentDefaultsHelpFormatter)

  parser.add_argument('-d', '--files', required=True, nargs='+', help = "A list of score files to evaluate.")
  parser.add_argument('-b', '--baselines', default=[], nargs='+', help = "A list of baseline results to add to the plot")

  parser.add_argument('-D', '--directory', default = '.', help = "A directory, where to find the --files")
  parser.add_argument('-B', '--baseline-directory', default = '.', help = "A directory, where to find the --baselines")

  parser.add_argument('-R', '--auto-baselines', choices = ('bioid', 'mit-cmu'), help = "Automatically add the baselines for the given database")

  parser.add_argument('-l', '--legends', nargs='+', help = "A list of legend strings used for ROC, CMC and DET plots; if given, must be the same number than --files plus --baselines.")
  parser.add_argument('-w', '--output', default = 'FROC.pdf', help = "If given, FROC curves will be plotted into the given pdf file.")
  parser.add_argument('-c', '--count-detections', action='store_true', help = "Counts the number of detections (positive is higher than negative, per file).")
  parser.add_argument('-n', '--max', type=int, nargs=2, default=(160,70), help = "The highest false alarms and the lowest detection rate to plot")
  parser.add_argument('-t', '--title', default='FROC', help = "The title of the plot")

  parser.add_argument('--self-test', action='store_true', help=argparse.SUPPRESS)

  # add verbosity option
  bob.core.log.add_command_line_option(parser)
  args = parser.parse_args(command_line_arguments)
  bob.core.log.set_verbosity_level(logger, args.verbose)

  if args.legends is not None:
    count = len(args.files) + (len(args.baselines) if args.baselines is not None else 0)
    if len(args.legends) != count:
      logger.error("The number of --files (%d) plus --baselines (%d) must be the same as --legends (%d)", len(args.files), len(args.baselines) if args.baselines else 0, len(args.legends))
      args.legends = None

  # update legends when they are not specified on command line
  if args.legends is None:
    args.legends = args.files if not args.baselines else args.files + args.baselines
    args.legends = [l.replace("_","-") for l in args.legends]

  if args.auto_baselines == 'bioid':
    args.baselines.extend(["baselines/baseline_detection_froba_mct_BIOID", "cosmin/BIOID/face.elbp.proj0.var.levels10.roc"])
    args.legends.extend(["Froba", "Cosmin"])
  elif args.auto_baselines == 'mit-cmu':
    args.baselines.extend(["baselines/baseline_detection_fcboost_MIT+CMU", "baselines/baseline_detection_viola_rapid1_MIT+CMU", "cosmin/MIT+CMU/face.elbp.proj0.var.levels10.roc"])
    args.legends.extend(["FcBoost", "Viola", "Cosmin"])

  return args
564727
def _add_plugin_options(self, available_plugins: Set[Type[Plugin]]) -> None:
        
        for plugin_class in available_plugins:
            # Add the current plugin's commands to the parser
            group = OptionGroup(self._parser, plugin_class.get_title(), plugin_class.get_description())
            for option in plugin_class.get_cli_option_group():
                group.add_option(option)
            self._parser.add_option_group(group)
895576
def add_arguments(self, parser):
        
        parser.usage = "%(prog)s [options] [ [DIR|FILE|FILE:LINE] ]+"
        parser.description = """\
        Run a number of feature tests with behave."""

        add_command_arguments(parser)
        add_behave_arguments(parser)
38912
def _add_two_argument_command(self, command, arg1, arg2):
        """"""
        self.lines.append("{} {} {}".format(command, arg1, arg2))
719869
def add_arg(self,arg, prepend=False):
        """"""

        self.args = [arg_.strip() for arg_ in self.args if arg_.strip()]

        if arg.title() not in self.args:
            if prepend:
                self.args = [arg.title()] + self.args
            else:
                self.args.append(arg.title())
948328
def add_arguments(parser):
  """"""

  default_log_path = os.path.realpath('logs')

  parser.add_argument('--log-dir', metavar='LOG', type=str,
      dest='logdir', default=default_log_path,
      help='Base directory used for logging (defaults to "%(default)s")')

  q_choices = (
      'default', 'all.q',
      'q_1day', 'q1d',
      'q_1week', 'q1w',
      'q_1month', 'q1m',
      'q_1day_mth', 'q1dm',
      'q_1week_mth', 'q1wm',
      'q_gpu', 'gpu',
      'q_long_gpu', 'lgpu',
      'q_short_gpu', 'sgpu',
      )

  parser.add_argument('--queue-name', metavar='QUEUE', type=str,
      dest='queue', default=q_choices[0], choices=q_choices,
      help='Queue for submission - one of ' + \
          '|'.join(q_choices) + ' (defaults to "%(default)s")')

  parser.add_argument('--hostname', metavar='HOSTNAME', type=str,
      dest='hostname', default=None,
      help='If set, it asks the queue to use only a subset of the available nodes')
  parser.add_argument('--memfree', metavar='MEMFREE', type=str,
      dest='memfree', default=None,
      help='Adds the \'-l mem_free\' argument to qsub')
  parser.add_argument('--hvmem', metavar='HVMEM', type=str,
      dest='hvmem', default=None,
      help='Adds the \'-l h_vmem\' argument to qsub')
  parser.add_argument('--pe-opt', metavar='PE_OPT', type=str,
      dest='pe_opt', default=None,
      help='Adds the \'--pe \' argument to qsub')

  parser.add_argument('--no-cwd', default=True, action='store_false',
      dest='cwd', help='Do not change to the current directory when starting the grid job')

  parser.add_argument('--dry-run', default=False, action='store_true',
      dest='dryrun', help='Does not really submit anything, just print what would do instead')

  parser.add_argument('--job-database', default=None,
      dest='statefile', help='The path to the state file that will be created with the submissions (defaults to the parent directory of your logs directory)')

  return parser
749769
def set_options(self, options):
        
        # COMMAND LINE OPTIONS
        self.wipe = options.get("wipe")
        self.test_run = options.get("test_run")
        self.quiet = options.get("test_run")
        self.container_name = options.get("container")
        self.verbosity = int(options.get("verbosity"))
        self.syncmedia = options.get("syncmedia")
        self.syncstatic = options.get("syncstatic")
        if self.test_run:
            self.verbosity = 2
        cli_includes = options.get("includes")
        cli_excludes = options.get("excludes")

        # CUMULUS CONNECTION AND SETTINGS FROM SETTINGS.PY
        if self.syncmedia and self.syncstatic:
            raise CommandError("options --media and --static are mutually exclusive")
        if not self.container_name:
            if self.syncmedia:
                self.container_name = CUMULUS["CONTAINER"]
            elif self.syncstatic:
                self.container_name = CUMULUS["STATIC_CONTAINER"]
            else:
                raise CommandError("must select one of the required options, either --media or --static")
        settings_includes = CUMULUS["INCLUDE_LIST"]
        settings_excludes = CUMULUS["EXCLUDE_LIST"]

        # PATH SETTINGS
        if self.syncmedia:
            self.file_root = os.path.abspath(settings.MEDIA_ROOT)
            self.file_url = settings.MEDIA_URL
        elif self.syncstatic:
            self.file_root = os.path.abspath(settings.STATIC_ROOT)
            self.file_url = settings.STATIC_URL
        if not self.file_root.endswith("/"):
            self.file_root = self.file_root + "/"
        if self.file_url.startswith("/"):
            self.file_url = self.file_url[1:]

        # SYNCSTATIC VARS
        # combine includes and excludes from the cli and django settings file
        self.includes = list(set(cli_includes + settings_includes))
        self.excludes = list(set(cli_excludes + settings_excludes))
        # transform glob patterns to regular expressions
        self.local_filenames = []
        self.create_count = 0
        self.upload_count = 0
        self.update_count = 0
        self.skip_count = 0
        self.delete_count = 0
762246
def add_input_option(option_name, *args)
      (@input_options ||= []).push(option_name)
      args.each { |ea| @input_options.push(Shellwords.escape(ea.to_s)) }

      # Support call chaining:
      self
    end
809511
def add_options(self):
        
        # These options need to be conflict-free to the containing
        # script, i.e. avoid short options if possible.
        self.script.add_bool_option("-i", "--interactive",
            help="interactive mode (prompt before changing things)")
        self.script.add_bool_option("--yes",
            help="positively answer all prompts (e.g. --delete --yes)")