Build the option parser for this script
331335
def __build_option_parser():
    
    description = """
    Tool to analyze Wireshark dumps of Sonos traffic.

    The files that are input to this script must be in the
    "Wireshark/tcpdump/...-libpcap" format, which can be exported from
    Wireshark.

    To use the open in browser function, a configuration file must be
    written. It should be in the same directory as this script and have the
    name "analyse_ws.ini". An example of such a file is given below ({0}
    indicates the file):
    [General]
    browser_command: epiphany {0}

    The browser command should be any command that opens a new tab in
    the program you wish to read the Wireshark dumps in.

    Separating Sonos traffic out from the rest of the network traffic is
    tricky. Therefore, it will in all likelyhood increase the succes of
    this tool, if the traffic is filtered in Wireshark to only show
    traffic to and from the Sonos unit. Still, if the analysis fails,
    then use the debug mode. This will show you the analysis of the
    traffic packet by packet and give you packet numbers so you can find
    and analyze problematic packets in Wireshark.
    """
    description = textwrap.dedent(description).strip()

    parser = \
        argparse.ArgumentParser(description=description,
                                formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('file_', metavar='FILE', type=str, nargs=1,
                        help='the file to analyze')
    parser.add_argument('-o', '--output-prefix', type=str,
                        help='the output filename prefix to use')
    parser.add_argument('-f', '--to-file', action='store_const', const=True,
                        help='output xml to files', default=False)
    parser.add_argument('-d', '--debug-analysis', action='store_const',
                        const=True,
                        help='writes debug information to file.debug',
                        default=False)
    parser.add_argument('-m', '--disable-color', action='store_const',
                        const=False, help='disable color in interactive mode',
                        default=COLOR, dest='color')
    parser.add_argument('-c', '--enable-color', action='store_const',
                        const=True, help='disable color in interactive mode',
                        default=COLOR, dest='color')
    parser.add_argument('-b', '--to-browser', action='store_const', const=True,
                        help='output xml to browser, implies --to-file',
                        default=False)
    parser.add_argument('-e', '--external-inner-xml', action='store_const',
                        const=True, help='show the internal separately '
                        'encoded xml externally instead of re-integrating it',
                        default=False)
    return parser
396828
def parse_options
      @options = {
        :config_paths    => Jammit::DEFAULT_CONFIG_PATH,
        :output_folder  => nil,
        :base_url       => nil,
        :force          => false
      }
      @option_parser = OptionParser.new do |opts|
        opts.on('-o', '--output PATH', 'output folder for packages (default: "public/assets")') do |output_folder|
          @options[:output_folder] = output_folder
        end
        opts.on('-c', '--config PATH', 'path to assets.yml (default: "config/assets.yml")') do |config_path|
          @options[:config_paths] = config_path
        end
        opts.on('-u', '--base-url URL', 'base URL for MHTML (ex: "http://example.com")') do |base_url|
          @options[:base_url] = base_url
        end
        opts.on('-f', '--force', 'force a rebuild of all assets') do |force|
          @options[:force] = force
        end
        opts.on('-p', '--packages LIST', 'list of packages to build (ex: "core,ui", default: all)') do |package_names|
          @options[:package_names] = package_names.split(/,\s*/).map {|n| n.to_sym }
        end
        opts.on('-P', '--public-root PATH', 'path to public assets (default: "public")') do |public_root|
          puts "Option for PUBLIC_ROOT"
          @options[:public_root] = public_root
        end
        opts.on_tail('-v', '--version', 'display Jammit version') do
          puts "Jammit version #{Jammit::VERSION}"
          exit
        end
      end
      @option_parser.banner = BANNER
      @option_parser.parse!(ARGV)
    end
1099201
def parser
      OptionParser.new do |parser|
        parser.summary_width = 34

        parser.banner = "Usage: tune [options]\n\n"

        parser.on('--init [PATH]',
                  'Create framework folder structure') do |dir|
          base_path = dir || 'lib'
          %w[groups pages steps].each do |folder|
            FileUtils.mkdir_p(base_path)
            path = "#{base_path}/#{folder}"
            exists = directory_exists?(path)
            print_directory(path, exists)
            create_directory(path) unless exists
          end
        end
      end
    end
899111
function optionBuilder(options) {
  options = options || {};

  var results = {stdin: [], args: [], files: []};
  Object.keys(options).map(function (option) {
    var p4option = p4options[option];
    if (!p4option) return;
    if (p4option.category !== 'unary') {
      if ((options[option] || {}).constructor !== p4option.type) return;
    }
    if (p4option.category === 'stdin') {
      results.stdin.push(p4option.cmd + options[option]);
      if (results.args.indexOf('-i') < 0) results.args.push('-i');
    } else if (p4option.cmd) {
      results.args.push(p4option.cmd);
      if (p4option.category === 'mixed') results.args.push(options[option]);
    } else {
      results.files = results.files.concat(options[option]);
    }
  });
  return results;
}
10185
def parse_options():
	

	parser = optparse.OptionParser(usage=USAGE, version=ontospy.VERSION)

	parser.add_option("-p", "--port",
			action="store", type="int", default=DEFAULT_PORT, dest="port",
			help="A number specifying which port to use for the server.")

	opts, args = parser.parse_args()

	# if not opts.all and not opts.query:
	#	parser.print_help()
	#	sys.exit(0)

	return opts, args
1356987
function parseOptions(type, options) {
    const ret = {
        indentChar: " ",
        indentSize: 2,
        startIndent: 1,
        switchCase: 0,
    }

    if (Number.isSafeInteger(type)) {
        ret.indentSize = type
    } else if (type === "tab") {
        ret.indentChar = "\t"
        ret.indentSize = 1
    }
    if (Number.isSafeInteger(options.switchCase)) {
        ret.switchCase = options.switchCase
    }
    if (Number.isSafeInteger(options.startIndent)) {
        ret.startIndent = options.startIndent
    }

    return ret
}
1246571
def option_parser
      @option_parser ||= OptionParser.new(banner, 25) do |opts|
        opts.banner = banner

        OptionSetter.new(self, opts).setup
      end
    end
1325323
def parse_options(args)
      opt_parser = OptionParser.new do |opts|
        # Set a banner, displayed at the top
        # of the help screen.
        opts.banner = 'Usage: k9 [options] [<filename.rb>]'
        # Define the options, and what they do
        options[:version] = false
        opts.on('-v', '--version', 'JRubyArt Version') do
          options[:version] = true
        end

        options[:install] = false
        opts.on('-i', '--install', 'Installs jruby-complete and examples') do
          options[:install] = true
        end

        options[:check] = false
        opts.on('-?', '--check', 'Prints configuration') do
          options[:check] = true
        end

        options[:app] = false
        opts.on('-a', '--app', 'Export as app NOT IMPLEMENTED YET') do
          options[:export] = true
        end

        options[:watch] = false
        opts.on('-w', '--watch', 'Watch/run the sketch') do
          options[:watch] = true
        end

        options[:run] = false
        opts.on('-r', '--run', 'Run the sketch') do
          options[:run] = true
        end

        options[:live] = false
        opts.on('-l', '--live', 'As above, with pry console bound to Processing.app') do
          options[:live] = true
        end

        options[:create] = false
        opts.on('-c', '--create', 'Create new outline sketch') do
          options[:create] = true
        end

        # This displays the help screen, all programs are
        # assumed to have this option.
        opts.on('-h', '--help', 'Display this screen') do
          puts opts
          exit
        end
      end
      @argc = opt_parser.parse(args)
      @filename = argc.shift
    end
249166
def parse
      opts = OptionParser.new(&method(:set_options))
      opts.parse!(@args)
      return process_url if url_present?
      opts.help
    end
603762
function parse(script, options, macros) {
	var name = script.attr('id');
	var text = script.text();
	var atts = assistant.directives(script);
	return compile(name, text, options, macros, atts);
}
654632
def parser
      @parser ||= OptionParser.new do |opts|
        opts.banner = USAGE

        opts.on('-b', '--build-id BuildID', 'BuildID[sha1] of libc.') do |b|
          @options[:build_id] = b
        end

        opts.on('-f', '--[no-]force-file', 'Force search gadgets in file instead of build id first.') do |f|
          @options[:force_file] = f
        end

        opts.on('-l', '--level OUTPUT_LEVEL', Integer, 'The output level.',
                'OneGadget automatically selects gadgets with higher successful probability.',
                'Increase this level to ask OneGadget show more gadgets it found.',
                'Default: 0') do |l|
          @options[:level] = l
        end

        opts.on('-n', '--near FUNCTIONS/FILE', 'Order gadgets by their distance to the given functions'\
                ' or to the GOT functions of the given file.') do |n|
          @options[:near] = n
        end

        opts.on('-r', '--[no-]raw', 'Output gadgets offset only, split with one space.') do |v|
          @options[:raw] = v
        end

        opts.on('-s', '--script exploit-script', 'Run exploit script with all possible gadgets.',
                'The script will be run as \'exploit-script $offset\'.') do |s|
          @options[:script] = s
        end

        opts.on('--info BuildID', 'Show version information given BuildID.') do |b|
          @options[:info] = b
        end

        opts.on('--version', 'Current gem version.') do |v|
          @options[:version] = v
        end
      end
    end
1027528
function parseOptions(options) {
    var defaultOptions = {
      verbose: false,
      prune: false,
      placeholder: false
    };
    options = options || {};

    // Delete sort option if not valid.
    if (options.sort && ['asc', 'desc'].indexOf(options.sort.toLowerCase()) === -1) {
      delete options.sort;
    }

    return _.extend(defaultOptions, options);
  }
848064
def optparse(*args)
      opts = OptionParser.new

      opts.banner = "usage: #{$0} [options]"

      opts.on('-H','--host HOST',"The host to run the server on","Default: #{@host}") do |host|
        @host = host
      end

      opts.on('-p','--port PORT',"The port to run the server on","Default: #{@port}") do |port|
        @port = port.to_i
      end

      opts.on('--s','--server NAME','Rack handler to run the server under') do |handler|
        @handler = handler
      end

      opts.on('-h','--help','Display the help output') do
        puts opts
        exit
      end

      begin
        opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        STDERR.puts e.message
        STDERR.puts opts
        exit -1
      end
    end
555147
def create_parser(self):
        
        return OptionParser(prog=self.prog_name,
                            usage=self.usage(),
                            version='%%prog %s' % self.get_version(),
                            option_list=self.option_list)
98710
function (parserOptions) {
            var me = this;
            if (parserOptions) {
                _gpfArrayForEach([
                    "header",
                    "separator",
                    "quote",
                    "newLine"
                ], function (optionName) {
                    if (parserOptions[optionName]) {
                        me["_" + optionName] = parserOptions[optionName];
                    }
                });
            }
        }
973952
function Parser(options) {
  this.options = merge({}, {
    headers: {
      included: false,
      downcase: true,
      upcase: true
    },
    delimiter: 'tab',
    decimalSign: 'comma'
  }, options);
}
9834
function parseOptions(options, callback) {
  "use strict";

  var _ = require('underscore');
  var config = require('./config');

  // get the UID and GID that we should run the workers as (allows workers to drop root privileges)
  if (options.u || options.g) {
    if (semver.gte(process.versions.node, '0.12.0')) {
      uidNumber((options.u ? options.u : null), (options.g ? options.g : null), function (err, uid, gid) {
        if (err) {
          Logger.error('Failed to change UID and GID for child processes.');
          Logger.verbose(err.stack || err.message || err);
        } else {
          options.u = uid;
          options.g = gid;
        }

        _.extend(config, options);
        callback();
      });
    } else {
      Logger.error('Changing UID and GID is only supported on node versions >= 0.12.0.  Ignoring requested UID and/or GID.');

      options.u = '';
      options.g = '';
      
      _.extend(config, options);
      callback();
    }
  } else {
    _.extend(config, options);
    callback();
  }
}