Class: Forematter::CommandRunner
- Inherits:
-
Cri::CommandRunner
- Object
- Cri::CommandRunner
- Forematter::CommandRunner
- Defined in:
- lib/forematter/command_runner.rb
Direct Known Subclasses
Forematter::Commands::Add, Forematter::Commands::Classify, Forematter::Commands::Cleanup, Forematter::Commands::Count, Forematter::Commands::List, Forematter::Commands::Merge, Forematter::Commands::Remove, Forematter::Commands::Rename, Forematter::Commands::Search, Forematter::Commands::Set, Forematter::Commands::Suggest, Forematter::Commands::Touch, Forematter::Commands::Unset
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/forematter/command_runner.rb', line 5 def call run rescue UsageException path = [command.supercommand] path.unshift(path[0].supercommand) until path[0].nil? super_usage = path[1..-1].map { |c| c.name + ' ' }.join $stderr.puts "usage: #{super_usage}#{command.usage}" exit 1 end |