Class: Readwise::CLI::BaseCommand
- Inherits:
-
Object
- Object
- Readwise::CLI::BaseCommand
- Defined in:
- lib/readwise/cli/base_command.rb
Direct Known Subclasses
Instance Method Summary collapse
- #execute(args) ⇒ Object
-
#initialize ⇒ BaseCommand
constructor
A new instance of BaseCommand.
Constructor Details
#initialize ⇒ BaseCommand
Returns a new instance of BaseCommand.
6 7 8 |
# File 'lib/readwise/cli/base_command.rb', line 6 def initialize = {} end |
Instance Method Details
#execute(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/readwise/cli/base_command.rb', line 10 def execute(args) (args) validate_arguments(args) run(args) rescue OptionParser::InvalidOption => e puts "Error: #{e.message}" show_help exit 1 rescue ArgumentError => e puts "Error: #{e.message}" exit 1 end |