Bug #6997 ยป rdoc_lib_optparse.patch
| optparse.rb (Arbeitskopie) | ||
|---|---|---|
|
# options.transfer_type = :auto
|
||
|
# options.verbose = false
|
||
|
#
|
||
|
# opts = OptionParser.new do |opts|
|
||
|
# opt_parser = OptionParser.new do |opts|
|
||
|
# opts.banner = "Usage: example.rb [options]"
|
||
|
#
|
||
|
# opts.separator ""
|
||
| ... | ... | |
|
# end
|
||
|
# end
|
||
|
#
|
||
|
# opts.parse!(args)
|
||
|
# opt_parser.parse!(args)
|
||
|
# options
|
||
|
# end # parse()
|
||
|
#
|
||
| ... | ... | |
|
#
|
||
|
# options = OptparseExample.parse(ARGV)
|
||
|
# pp options
|
||
|
# pp ARGV
|
||
|
#
|
||
|
# === Shell Completion
|
||
|
#
|
||
| ... | ... | |
|
#
|
||
|
# Same as #order, but removes switches destructively.
|
||
|
# Non-option arguments remain in +argv+.
|
||
|
#
|
||
|
def order!(argv = default_argv, &nonopt)
|
||
|
parse_in_order(argv, &nonopt)
|
||
| ... | ... | |
|
#
|
||
|
# Same as #permute, but removes switches destructively.
|
||
|
# Non-option arguments remain in +argv+.
|
||
|
#
|
||
|
def permute!(argv = default_argv)
|
||
|
nonopts = []
|
||
| ... | ... | |
|
#
|
||
|
# Same as #parse, but removes switches destructively.
|
||
|
# Non-option arguments remain in +argv+.
|
||
|
#
|
||
|
def parse!(argv = default_argv)
|
||
|
if ENV.include?('POSIXLY_CORRECT')
|
||