Module: Wukong::Runner::HelpMessage

Included in:
BootSequence
Defined in:
lib/wukong/runner/help_message.rb

Overview

Defines methods for handling help messages.

Runners which want to modify how help messages are generated should override the contextualize_help_message! instance method.

Instance Method Summary collapse

Instance Method Details

#dump_helpObject

Print a help message.



28
29
30
# File 'lib/wukong/runner/help_message.rb', line 28

def dump_help
  settings.dump_help
end

#dump_help_and_exit!Object

Print a help message and exit.

Raises:

  • (SystemExit)


35
36
37
38
# File 'lib/wukong/runner/help_message.rb', line 35

def dump_help_and_exit!
  dump_help
  exit(1)
end

#help_given?true, false

Was the --help option specified on the command line?

The boot sequence for a Runner strips out the --help option to allow individual Runner classes to customize their help messages.

Returns:

  • (true, false)


17
18
19
# File 'lib/wukong/runner/help_message.rb', line 17

def help_given?
  !!@help_given
end

#strip_help_param!Object

Strip the --help message from the original ARGV, storing whether or not it was given for later.



23
24
25
# File 'lib/wukong/runner/help_message.rb', line 23

def strip_help_param!
  @help_given = ARGV.delete('--help')
end