Class: Benry::CmdApp::BuiltInAction

Inherits:
ActionScope show all
Defined in:
lib/benry/cmdapp.rb

Instance Method Summary collapse

Methods inherited from ActionScope

#__clear_recursive_reference, #action_error, #at_end, category, current_prefix, define_alias, inherited, #initialize, #inspect, method_added, #option_error, optionset, #run_action, #run_once

Constructor Details

This class inherits a constructor from Benry::CmdApp::ActionScope

Instance Method Details

#help(action = nil, all: false) ⇒ Object



1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
# File 'lib/benry/cmdapp.rb', line 1004

def help(action=nil, all: false)
  #; [!2n99u] raises ActionError if current application is not nil.
  app = Benry::CmdApp.current_app()  or
    raise ActionError.new("'help' action is available only when invoked from application.")
  #; [!g0n06] prints application help message if action name not specified.
  #; [!epj74] prints action help message if action name specified.
  str = app.render_help_message(action, all: all)
  #; [!2t43b] deletes escape characters from help message when non-color mode.
  str = Util.delete_escape_chars(str) unless Util.color_mode?
  print str
end