mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
a3ceb69168
commit
bbccabe6d6
3 changed files with 55 additions and 4 deletions
|
@ -8,7 +8,6 @@
|
|||
# See OptionParser for documentation.
|
||||
#
|
||||
|
||||
|
||||
#--
|
||||
# == Developer Documentation (not for RDoc output)
|
||||
#
|
||||
|
@ -425,6 +424,7 @@
|
|||
# If you have any questions, file a ticket at http://bugs.ruby-lang.org.
|
||||
#
|
||||
class OptionParser
|
||||
# The version string
|
||||
OptionParser::Version = "0.4.0"
|
||||
|
||||
# :stopdoc:
|
||||
|
@ -438,6 +438,8 @@ class OptionParser
|
|||
# and resolved against a list of acceptable values.
|
||||
#
|
||||
module Completion
|
||||
# :nodoc:
|
||||
|
||||
def self.regexp(key, icase)
|
||||
Regexp.new('\A' + Regexp.quote(key).gsub(/\w+\b/, '\&\w*'), icase)
|
||||
end
|
||||
|
@ -510,6 +512,8 @@ class OptionParser
|
|||
# RequiredArgument, etc.
|
||||
#
|
||||
class Switch
|
||||
# :nodoc:
|
||||
|
||||
attr_reader :pattern, :conv, :short, :long, :arg, :desc, :block
|
||||
|
||||
#
|
||||
|
@ -715,10 +719,10 @@ class OptionParser
|
|||
conv_arg(arg)
|
||||
end
|
||||
|
||||
def self.incompatible_argument_styles(*)
|
||||
def self.incompatible_argument_styles(*) # :nodoc:
|
||||
end
|
||||
|
||||
def self.pattern
|
||||
def self.pattern # :nodoc:
|
||||
Object
|
||||
end
|
||||
|
||||
|
@ -804,6 +808,8 @@ class OptionParser
|
|||
# matching pattern and converter pair. Also provides summary feature.
|
||||
#
|
||||
class List
|
||||
# :nodoc:
|
||||
|
||||
# Map from acceptable argument types to pattern and converter pairs.
|
||||
attr_reader :atype
|
||||
|
||||
|
@ -1185,6 +1191,11 @@ XXX
|
|||
end
|
||||
|
||||
@stack = [DefaultList]
|
||||
#
|
||||
# Returns the global top option list.
|
||||
#
|
||||
# Do not use directly.
|
||||
#
|
||||
def self.top() DefaultList end
|
||||
|
||||
#
|
||||
|
@ -1297,10 +1308,24 @@ XXX
|
|||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Shows warning message with the program name
|
||||
#
|
||||
# +mesg+:: Message, defaulted to +$!+.
|
||||
#
|
||||
# See Kernel#warn.
|
||||
#
|
||||
def warn(mesg = $!)
|
||||
super("#{program_name}: #{mesg}")
|
||||
end
|
||||
|
||||
#
|
||||
# Shows message with the program name then aborts.
|
||||
#
|
||||
# +mesg+:: Message, defaulted to +$!+.
|
||||
#
|
||||
# See Kernel#abort.
|
||||
#
|
||||
def abort(mesg = $!)
|
||||
super("#{program_name}: #{mesg}")
|
||||
end
|
||||
|
@ -2342,7 +2367,8 @@ XXX
|
|||
super
|
||||
obj.instance_eval {@optparse = nil}
|
||||
end
|
||||
def initialize(*args)
|
||||
|
||||
def initialize(*args) # :nodoc:
|
||||
super
|
||||
@optparse = nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue