Module: CommandKit::Main::ClassMethods
- Defined in:
- lib/command_kit/main.rb
Overview
Class-level methods.
Instance Method Summary collapse
-
#main(argv = [], **kwargs) ⇒ Integer
Initializes the command class with the given keyword arguments, then calls main with the given
argv
. -
#start(argv = ARGV, **kwargs) ⇒ Object
Starts the command and then exits.
Instance Method Details
#main(argv = [], **kwargs) ⇒ Integer
Initializes the command class with the given keyword arguments, then
calls main with the given argv
.
78 79 80 |
# File 'lib/command_kit/main.rb', line 78 def main(argv=[], **kwargs) new(**kwargs).main(argv) end |
#start(argv = ARGV, **kwargs) ⇒ Object
Starts the command and then exits.
53 54 55 56 57 58 59 60 61 |
# File 'lib/command_kit/main.rb', line 53 def start(argv=ARGV, **kwargs) exit main(argv, **kwargs) rescue Interrupt # https://tldp.org/LDP/abs/html/exitcodes.html exit 130 rescue Errno::EPIPE # STDOUT pipe broken exit 0 end |