Class: OptionParser::Switch::OptionalArgument
- Inherits:
-
OptionParser::Switch
- Object
- OptionParser::Switch
- OptionParser::Switch::OptionalArgument
- Defined in:
- lib/llm/shell/internal/optparse/lib/optparse.rb
Overview
Switch that can omit argument.
Instance Attribute Summary
Attributes inherited from OptionParser::Switch
#arg, #block, #conv, #desc, #long, #pattern, #short
Instance Method Summary collapse
-
#parse(arg, argv, &error) ⇒ Object
Parses argument if given, or uses default value.
-
#pretty_head ⇒ Object
:nodoc:.
Methods inherited from OptionParser::Switch
#add_banner, #compsys, guess, incompatible_argument_styles, #initialize, #match_nonswitch?, #omitted_argument, pattern, #pretty_print, #pretty_print_contents, #summarize, #switch_name
Constructor Details
This class inherits a constructor from OptionParser::Switch
Instance Method Details
#parse(arg, argv, &error) ⇒ Object
Parses argument if given, or uses default value.
770 771 772 773 774 775 776 |
# File 'lib/llm/shell/internal/optparse/lib/optparse.rb', line 770 def parse(arg, argv, &error) if arg conv_arg(*parse_arg(arg, &error)) else omitted_argument conv_arg(arg) end end |
#pretty_head ⇒ Object
:nodoc:
778 779 780 |
# File 'lib/llm/shell/internal/optparse/lib/optparse.rb', line 778 def pretty_head # :nodoc: "Optional" end |