Class: Benry::CmdApp::ActionHelpBuilder

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

Constant Summary

Constants inherited from BaseHelpBuilder

BaseHelpBuilder::HEADER_ABBREVS, BaseHelpBuilder::HEADER_ACTIONS, BaseHelpBuilder::HEADER_ALIASES, BaseHelpBuilder::HEADER_CATEGORIES, BaseHelpBuilder::HEADER_DESCRIPTION, BaseHelpBuilder::HEADER_OPTIONS, BaseHelpBuilder::HEADER_USAGE

Instance Method Summary collapse

Methods inherited from BaseHelpBuilder

#initialize

Constructor Details

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

Instance Method Details

#build_help_message(metadata, all: false) ⇒ Object



1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
# File 'lib/benry/cmdapp.rb', line 1583

def build_help_message(, all: false)
  #; [!f3436] returns help message of an action.
  #; [!8acs1] includes hidden options if `all: true` passed.
  #; [!mtvw8] includes 'Aliases:' section if action has any aliases.
  #; [!vcg9w] not include 'Options:' section if action has no options.
  #; [!1auu5] not include '[<options>]' in 'Usage:'section if action has no options.
  sb = []
  sb << section_preamble()
  sb << section_usage(, all: all)
  sb << section_description()
  sb << section_options(, all: all)
  sb << section_aliases(, all: all)
  sb << section_postamble()
  return sb.compact().join("\n")
end