class OptionParser::Switch::OptionalArgument
可以省略参数的 Switch
。
公共实例方法
源代码
# File lib/optparse.rb, line 763 def parse(arg, argv, &error) if arg conv_arg(*parse_arg(arg, &error)) else omitted_argument conv_arg(arg) end end
如果给定参数则解析参数,否则使用默认值。
可以省略参数的 Switch
。
# File lib/optparse.rb, line 763 def parse(arg, argv, &error) if arg conv_arg(*parse_arg(arg, &error)) else omitted_argument conv_arg(arg) end end
如果给定参数则解析参数,否则使用默认值。