Class: AvoCli::CLI::Commands::BaseCommand
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- AvoCli::CLI::Commands::BaseCommand
- Defined in:
- lib/avo_cli/cli.rb
Instance Method Summary collapse
Instance Method Details
#halt(message: nil) ⇒ Object
15 16 17 18 19 |
# File 'lib/avo_cli/cli.rb', line 15 def halt(message: nil) ||= "#{self.class} failed." yell exit end |
#run(command) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/avo_cli/cli.rb', line 7 def run(command) result = cmd.run(command) halt if result.failed? result rescue TTY::Command::ExitError halt end |