This is a modified version of cucumber/lib/cli
499950
function Cli(argv) {
  var Cucumber = require('cucumber');
  var Command = require('commander').Command;
  var path = require('path');

  function collect(val, memo) {
    memo.push(val);
    return memo;
  }

  function getProgram() {
    var program = new Command(path.basename(argv[1]));

    program
      .usage('[options] [<DIR|FILE[:LINE]>...]')
      .version(Cucumber.VERSION, '-v, --version')
      .option('-b, --backtrace', 'show full backtrace for errors')
      .option('--compiler <EXTENSION:MODULE>', 'require files with the given EXTENSION after requiring MODULE (repeatable)', collect, [])
      .option('-d, --dry-run', 'invoke formatters without executing steps')
      .option('--fail-fast', 'abort the run on first failure')
      .option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable)', collect, ['pretty'])
      .option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', collect, [])
      .option('--no-colors', 'disable colors in formatter output')
      .option('--no-snippets', 'hide step definition snippets for pending steps')
      .option('--no-source', 'hide source uris')
      .option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', collect, [])
      .option('-r, --require <FILE|DIR>', 'require files before executing features (repeatable)', collect, [])
      .option('--snippet-syntax <FILE>', 'specify a custom snippet syntax')
      .option('-S, --strict', 'fail if there are any undefined or pending steps')
      .option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', collect, []);

    program.on('--help', function () {
      console.log('  For more details please visit https://github.com/cucumber/cucumber-js#cli\n');
    });

    return program;
  }

  function getConfiguration() {
    var program = getProgram();
    program.parse(argv);
    var profileArgs = Cucumber.Cli.ProfilesLoader.getArgs(program.profile);
    if (profileArgs.length > 0) {
      var fullArgs = argv.slice(0, 2).concat(profileArgs).concat(argv.slice(2));
      program = getProgram();
      program.parse(fullArgs);
    }
    var configuration = Cucumber.Cli.Configuration(program.opts(), program.args);
    return configuration;
  }

  var self = {
    run: function run(callback) {
      var configuration = getConfiguration();
      var runtime = Cucumber.Runtime(configuration);
      var formatters = [createIpcFormatter()].concat(configuration.getFormatters());
      formatters.forEach(function (formatter) {
        runtime.attachListener(formatter);
      });
      try {
        runtime.start(callback);
      } catch (e) {
        console.log(e.stack || e)
        callback(false)
      }
    }
  };
  return self;
}
345052
def _bsecurate_cli_make_graph_file(args):
    ''''''

    curate.make_graph_file(args.basis, args.outfile, args.render, args.version, args.data_dir)
    return ''
826115
def cli(ctx, data, verbose, color, format, editor):
    
    ctx.obj['verbose'] = verbose
    if verbose:
        logging.basicConfig(level=logging.INFO)
        logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
    ctx.obj['datadir'] = os.path.abspath(data)
    if 'db' not in ctx.obj:
        ctx.obj['db'] = get_db(data)
    if color is None:
        ctx.obj['term'] = blessings.Terminal()
    elif color is True:
        ctx.obj['term'] = blessings.Terminal(force_styling=True)
    elif color is False:
        ctx.obj['term'] = blessings.Terminal(force_styling=None)
    if 'PYVO_TEST_NOW' in os.environ:
        # Fake the current date for testing
        ctx.obj['now'] = datetime.datetime.strptime(
            os.environ['PYVO_TEST_NOW'], '%Y-%m-%d %H:%M:%S')
    else:
        ctx.obj['now'] = datetime.datetime.now()
    ctx.obj['format'] = format
    ctx.obj['editor'] = shlex.split(editor)
839863
def bootstrap(**kwargs):
    
    # the user for the image is `ec2-user`, there is no sudo, but we can su to root w/o password
    original_host = env.host_string
    env.host_string = 'ec2-user@%s' % env.instance.uid
    bootstrap_files = env.instance.config.get('bootstrap-files', 'bootstrap-files')
    put('%s/authorized_keys' % bootstrap_files, '/tmp/authorized_keys')
    put(join(bsdploy_path, 'enable_root_login_on_daemonology.sh'), '/tmp/', mode='0775')
    run("""su root -c '/tmp/enable_root_login_on_daemonology.sh'""")
    # revert back to root
    env.host_string = original_host
    # give sshd a chance to restart
    sleep(2)
    run('rm /tmp/enable_root_login_on_daemonology.sh')

    # allow overwrites from the commandline
    env.instance.config.update(kwargs)

    bu = BootstrapUtils()
    bu.ssh_keys = None
    bu.upload_authorized_keys = False
    bu.bootstrap_files_yaml = 'daemonology-files.yml'
    bu.print_bootstrap_files()

    bu.create_bootstrap_directories()
    bu.upload_bootstrap_files({})
    # we need to install python here, because there is no way to install it via
    # ansible playbooks
    bu.install_pkg('/', chroot=False, packages=['python27'])
21447
def cli(ctx, collections, threads, debug):
    
    ctx.obj = {
        'collections': collections,
        'debug': debug,
        'threads': threads
    }
    if debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig(level=logging.INFO)
1248185
def _check_lib(self, remake, compiler, debug, profile):
        
        from os import path
        if self.link is None or not path.isfile(self.link):
            self.makelib(remake, True, compiler, debug, profile)
1220150
def cli(config, in_file, out_file, verbose):
    
    config.out_file = out_file
    config.verbose = verbose
    config.in_file = in_file
    config.out_file = out_file
598565
def update kwargs={}
      ignore_cksum = kwargs.arg :ignore_cksum, false
      ignore_sigs = kwargs.arg :ignore_sigs, false

      cmd = 'aptly mirror update'
      cmd += ' -ignore-checksums' if ignore_cksum
      cmd += ' -ignore-signatures' if ignore_sigs
      cmd += " #{@name.quote}"

      Aptly::runcmd cmd
    end
192922
def update(cls, content, dependency, version, spec="==", hashes=()):
        
        new_line = "{name}{spec}{version}".format(name=dependency.full_name, spec=spec, version=version)
        appendix = ''
        # leave environment markers intact
        if ";" in dependency.line:
            # condense multiline, split out the env marker, strip comments and --hashes
            new_line += ";" + dependency.line.splitlines()[0].split(";", 1)[1] \
                .split("#")[0].split("--hash")[0].rstrip()
        # add the comment
        if "#" in dependency.line:
            # split the line into parts: requirement and comment
            parts = dependency.line.split("#")
            requirement, comment = parts[0], "#".join(parts[1:])
            # find all whitespaces between the requirement and the comment
            whitespaces = (hex(ord('\t')), hex(ord(' ')))
            trailing_whitespace = ''
            for c in requirement[::-1]:
                if hex(ord(c)) in whitespaces:
                    trailing_whitespace += c
                else:
                    break
            appendix += trailing_whitespace + "#" + comment
        # if this is a hashed requirement, add a multiline break before the comment
        if dependency.hashes and not new_line.endswith("\\"):
            new_line += " \\"
        # if this is a hashed requirement, add the hashes
        if hashes:
            for n, new_hash in enumerate(hashes):
                new_line += "\n    --hash={method}:{hash}".format(
                    method=new_hash['method'],
                    hash=new_hash['hash']
                )
                # append a new multiline break if this is not the last line
                if len(hashes) > n + 1:
                    new_line += " \\"
        new_line += appendix

        regex = cls.SUB_REGEX.format(re.escape(dependency.line))

        return re.sub(regex, new_line, content, flags=re.MULTILINE)
291090
def main(argv=None):
    
    # Get command line arguments, validate them, and normalize them
    opts = cmdparse.parse_args(argv)
    assert validate_opts.validate(opts)
    opts = normalize_opts.normalize(opts)

    if opts.verbose:
        # Update client: print input and output directories
        messages.print_input_output(opts)

    file_paths = fileparse.get_file_list(opts)
    assert validate_files.validate(file_paths, opts)

    if opts.verbose and opts.is_dir:
        # Update client: print files that will be parsed
        messages.print_files(opts, file_paths)

    # For now, only using default GitHub Markdown for parsing
    # Collect tag/anchor combinations
    collector = make_github_markdown_collector(opts)
    anchors, duplicate_tags = collector.collect(file_paths)
    assert validate_anchors.validate(anchors, duplicate_tags, opts)

    # Write files using previously found AnchorHub tags and generated anchors
    writer = make_github_markdown_writer(opts)
    counter = writer.write(file_paths, anchors, opts)

    if opts.verbose:
        if opts.is_dir:
            # Update client: print files that had modifications
            messages.print_modified_files(opts, anchors)
        # Print summary statistics
        messages.print_summary_stats(counter)
936806
def lib(params = {})
    ldflags   = params[:settings]['ADD_LDFLAGS'] + ' ' + @settings['LDFLAGS']
    objs      = params[:objects].join(' ')
    dep_libs = (params[:libs] + libs_for_binary(params[:lib])).uniq
    libs      = linker_line_for(dep_libs)
    extension = File.extname(params[:lib])

    case extension
      when ('.a')
        # need to use 'touch' for correct timestamp, ar doesn't update the timestamp
        # if archive hasn't changed
        success = sh("#{@settings['AR']} curv #{params[:lib]} #{objs}")
        touch(params[:lib]) if success
      when '.so'
        sh "#{@settings['CXX']} -shared  #{ldflags} #{libs} #{objs} -o #{params[:lib]}"

        if (@config.stripped) && File.exist?(params[:lib])
          FileUtils.cp(params[:lib], "#{params[:lib]}.unstripped", :verbose => true)
          sh "#{@settings['STRIP']} #{params[:lib]}"
        end
      else
        raise "unsupported library extension (#{extension})!"
    end
  end
1002819
def run_coral(clus_obj, out_dir, args):
    
    if not args.bed:
        raise ValueError("This module needs the bed file output from cluster subcmd.")
    workdir = op.abspath(op.join(args.out, 'coral'))
    safe_dirs(workdir)
    bam_in = op.abspath(args.bam)
    bed_in = op.abspath(args.bed)
    reference = op.abspath(args.ref)
    with chdir(workdir):
        bam_clean = coral.prepare_bam(bam_in, bed_in)
        out_dir = op.join(workdir, "regions")
        safe_dirs(out_dir)
        prefix = "seqcluster"
        loci_file = coral.detect_regions(bam_clean, bed_in, out_dir, prefix)
        coral.create_features(bam_clean, loci_file, reference, out_dir)
206595
function initLibraries(cfg = {}) {
	_.each(configMap, (keys, libName) => {
		let lib = libs[libName];
		let options = {};
		_.each(keys, (key) => options[key] = cfg[key]);
		lib.setOptions && lib.setOptions(options);
	});
}
21059
def main():
    
    plugins = DefaultPluginManager()
    plugins.load_plugins()

    parser, _ = create_argparser()
    # add the updater protocol options to the CLI:
    for kls in updater_classes():
        kls.register_arguments(parser)

    for kls in detector_classes():
        kls.register_arguments(parser)

    # add the plugin options to the CLI:
    from os import environ
    plugins.options(parser, environ)

    args = parser.parse_args()

    if args.debug:
        args.verbose_count = 5  # some high number

    log_level = max(int(logging.WARNING / 10) - args.verbose_count, 0) * 10
    # print(log_level)
    logging.basicConfig(level=log_level, format="%(levelname)s %(message)s")
    # logging.debug("args %r", args)

    if args.version:
        from . import __version__
        print("dyndnsc %s" % __version__)  # noqa
        return 0

    # silence 'requests' logging
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.WARNING)

    logging.debug(parser)
    cfg = get_configuration(args.config)

    if args.listpresets:
        list_presets(cfg)
        return 0

    if args.config:
        collected_configs = collect_config(cfg)
    else:
        parsed_args = parse_cmdline_args(args, updater_classes().union(detector_classes()))
        logging.debug("parsed_args %r", parsed_args)

        collected_configs = {
            "cmdline": {
                "interval": int(args.sleeptime)
            }
        }
        collected_configs["cmdline"].update(parsed_args)

    plugins.configure(args)
    plugins.initialize()

    logging.debug("collected_configs: %r", collected_configs)
    dyndnsclients = []
    for thisconfig in collected_configs:
        logging.debug("Initializing client for '%s'", thisconfig)
        # done with options, bring on the dancing girls
        dyndnsclient = getDynDnsClientForConfig(
            collected_configs[thisconfig], plugins=plugins)
        if dyndnsclient is None:
            return 1
        # do an initial synchronization, before going into endless loop:
        dyndnsclient.sync()
        dyndnsclients.append(dyndnsclient)

    run_forever_callable = partial(run_forever, dyndnsclients)

    if args.daemon:
        import daemonocle
        daemon = daemonocle.Daemon(worker=run_forever_callable)
        daemon.do_action("start")
        args.loop = True

    if args.loop:
        run_forever_callable()

    return 0
1302343
def make_lib(self, version):
        
        if os.path.exists(POETRY_LIB_BACKUP):
            shutil.rmtree(POETRY_LIB_BACKUP)

        # Backup the current installation
        if os.path.exists(POETRY_LIB):
            shutil.copytree(POETRY_LIB, POETRY_LIB_BACKUP)
            shutil.rmtree(POETRY_LIB)

        try:
            self._make_lib(version)
        except Exception:
            if not os.path.exists(POETRY_LIB_BACKUP):
                raise

            shutil.copytree(POETRY_LIB_BACKUP, POETRY_LIB)
            shutil.rmtree(POETRY_LIB_BACKUP)

            raise
        finally:
            if os.path.exists(POETRY_LIB_BACKUP):
                shutil.rmtree(POETRY_LIB_BACKUP)
169057
def pkgconfig(*packages, **kw):
	
	kw = kw.copy()
	flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}  # kwargs of :class:`Extension`
	for token in check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).split():
		if token[:2] in flag_map:
			kw.setdefault(flag_map[token[:2]], []).append(token[2:])
		else:  # throw others to extra_link_args
			kw.setdefault('extra_link_args', []).append(token)
	return kw
699225
function Cli(hydro, argv) {
  if (!(this instanceof Cli)) {
    return new Cli(hydro, argv);
  }

  this.hydro = hydro;
  this.argv = argv;
  this.options = {};
  this.conf = [];
  this.commands = [ 'help', 'version' ];
  this.arrayParams = { plugins: true };
}