Class Cri::Command
In: lib/cri/command.rb
Parent: Object

Cri::Command represents a command that can be executed on the commandline. It is an abstract superclass for all commands.

Methods

<=>   aliases   help   long_desc   name   option_definitions   run   short_desc   usage  

Attributes

base  [RW] 

Public Instance methods

Compares this command‘s name to the other given command‘s name.

Returns an array of strings containing the aliases for this command. Subclasses must implement this method.

Returns the help text for this command.

Returns a string containing this command‘s complete description, which should explain what this command does and how it works in detail. Subclasses must implement this method.

Returns a string containing the name of thi command. Subclasses must implement this method.

Returns an array containing this command‘s option definitions. See the documentation for Cri::OptionParser for details on what option definitions look like. Subclasses may implement this method if the command has options.

Executes the command. Subclasses must implement this method (obviously… what‘s the point of a command that can‘t be run?).

options:A hash containing the parsed commandline options. For example, ’—foo=bar’ will be converted into { :foo => ‘bar’ }. See the Cri::OptionParser documentation for details.
arguments:An array of strings representing the commandline arguments given to this command.

Returns a string containing this command‘s short description, which should not be longer than 50 characters. Subclasses must implement this method.

Returns a string containing this command‘s usage. Subclasses must implement this method.

[Validate]