renamed OptionParser#new to #define.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
90c4dae08f
commit
b480079083
@ -1022,35 +1022,35 @@ Default options, which never appear in option summary.
|
|||||||
|
|
||||||
cf. ((<OptionParser#switch>)).
|
cf. ((<OptionParser#switch>)).
|
||||||
=end #'#"#`#
|
=end #'#"#`#
|
||||||
def new(*opts, &block)
|
def define(*opts, &block)
|
||||||
top.append(*(sw = make_switch(*opts, &block)))
|
top.append(*(sw = make_switch(*opts, &block)))
|
||||||
sw[0]
|
sw[0]
|
||||||
end
|
end
|
||||||
def on(*opts, &block)
|
def on(*opts, &block)
|
||||||
new(*opts, &block)
|
define(*opts, &block)
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
alias def_option new
|
alias def_option define
|
||||||
|
|
||||||
def new_head(*opts, &block)
|
def define_head(*opts, &block)
|
||||||
top.prepend(*(sw = make_switch(*opts, &block)))
|
top.prepend(*(sw = make_switch(*opts, &block)))
|
||||||
sw[0]
|
sw[0]
|
||||||
end
|
end
|
||||||
def on_head(*opts, &block)
|
def on_head(*opts, &block)
|
||||||
new_head(*opts, &block)
|
define_head(*opts, &block)
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
alias def_head_option new_head
|
alias def_head_option define_head
|
||||||
|
|
||||||
def new_tail(*opts, &block)
|
def define_tail(*opts, &block)
|
||||||
base.append(*(sw = make_switch(*opts, &block)))
|
base.append(*(sw = make_switch(*opts, &block)))
|
||||||
sw[0]
|
sw[0]
|
||||||
end
|
end
|
||||||
def on_tail(*opts, &block)
|
def on_tail(*opts, &block)
|
||||||
new_tail(*opts, &block)
|
define_tail(*opts, &block)
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
alias def_tail_option new_tail
|
alias def_tail_option define_tail
|
||||||
|
|
||||||
def separator(string)
|
def separator(string)
|
||||||
top.append(string, nil, nil)
|
top.append(string, nil, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user