Module: Boson::Command::MoreMethodInspector
- Included in:
- Boson::Command
- Defined in:
- lib/boson/more_method_inspector.rb
Instance Method Summary collapse
-
#basic_usage ⇒ Object
One-line usage of args with default values.
-
#option_help ⇒ Object
Help string for options if a command has it.
-
#usage ⇒ Object
keep?.
Instance Method Details
#basic_usage ⇒ Object
One-line usage of args with default values
54 55 56 57 58 59 60 |
# File 'lib/boson/more_method_inspector.rb', line 54 def basic_usage return '' if .nil? && args.nil? args ? usage_args.map {|e| (e.size < 2) ? "[#{e[0]}]" : "[#{e[0]}=#{@file_parsed_args ? e[1] : e[1].inspect}]" }.join(' ') : '[*unknown]' end |
#option_help ⇒ Object
Help string for options if a command has it.
63 64 65 |
# File 'lib/boson/more_method_inspector.rb', line 63 def option_help @options ? option_parser.to_s : '' end |
#usage ⇒ Object
keep?
68 69 70 |
# File 'lib/boson/more_method_inspector.rb', line 68 def usage basic_usage + option_help end |