Class: Tsearch::CLI
- Inherits:
-
Thor
- Object
- Thor
- Tsearch::CLI
- Defined in:
- lib/tsearch/cli.rb
Overview
Handle the application command line parsing and the dispatch to various command objects
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
14 15 16 |
# File 'lib/tsearch/cli.rb', line 14 def self.exit_on_failure? true end |
Instance Method Details
#search ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/tsearch/cli.rb', line 45 def search if [:help] invoke :help, ['search'] else if [:string].nil? && [:imdb].nil? && [:tvdb].nil? && [:themoviedb].nil? raise RequiredArgumentMissingError, 'At least one of the search options must be provided: string, imdb, tvdb, themoviedb' end require_relative 'commands/search' Tsearch::Commands::Search.new().execute end end |