Module: Inch::CLI::Command
- Defined in:
- lib/inch/cli/command/base.rb,
lib/inch/cli/command/diff.rb,
lib/inch/cli/command/list.rb,
lib/inch/cli/command/show.rb,
lib/inch/cli/command/stats.rb,
lib/inch/cli/command/console.rb,
lib/inch/cli/command/inspect.rb,
lib/inch/cli/command/suggest.rb,
lib/inch/cli/command/base_list.rb,
lib/inch/cli/command/base_object.rb,
lib/inch/cli/command/output/base.rb,
lib/inch/cli/command/output/diff.rb,
lib/inch/cli/command/output/list.rb,
lib/inch/cli/command/output/show.rb,
lib/inch/cli/command/options/base.rb,
lib/inch/cli/command/options/diff.rb,
lib/inch/cli/command/options/list.rb,
lib/inch/cli/command/options/show.rb,
lib/inch/cli/command/output/stats.rb,
lib/inch/cli/command/options/stats.rb,
lib/inch/cli/command/output/console.rb,
lib/inch/cli/command/output/inspect.rb,
lib/inch/cli/command/output/suggest.rb,
lib/inch/cli/command/options/console.rb,
lib/inch/cli/command/options/inspect.rb,
lib/inch/cli/command/options/suggest.rb,
lib/inch/cli/command/options/base_list.rb,
lib/inch/cli/command/options/base_object.rb
Overview
The classes in the Command namespace are controller objects for the command-line interface.
A Command object is run via the class method run
(see Base.run). Its parameters are the command-line arguments (typically ARGV).
A Command object utilizes an Options object to interpret the command- line arguments, then processes files and/or objects and finally uses an Output object to present the results to the user.
To create a new command Foo
you must first subclass any of
-
Command::Base
-
Command::BaseList
-
Command::BaseObject
Then you have to subclass Options and Output classes as well, to finally get something like this:
-
Command::Foo
-
Command::Options::Foo
-
Command::Output::Foo
For an example, take a look at the Suggest command.
Defined Under Namespace
Modules: Options, Output Classes: Base, BaseList, BaseObject, Console, Diff, Inspect, List, Show, Stats, Suggest