Class: OAuth::CLI

Inherits:
Object show all
Defined in:
lib/oauth/cli.rb,
lib/oauth/cli/base_command.rb,
lib/oauth/cli/help_command.rb,
lib/oauth/cli/sign_command.rb,
lib/oauth/cli/query_command.rb,
lib/oauth/cli/version_command.rb,
lib/oauth/cli/authorize_command.rb

Defined Under Namespace

Classes: AuthorizeCommand, BaseCommand, HelpCommand, QueryCommand, SignCommand, VersionCommand

Constant Summary collapse

ALIASES =
{
  'h' => 'help',
  'v' => 'version',
  'q' => 'query',
  'a' => 'authorize',
  's' => 'sign',
}

Instance Method Summary collapse

Constructor Details

#initialize(stdout, stdin, stderr, command, arguments) ⇒ CLI

Returns a new instance of CLI.



19
20
21
22
23
# File 'lib/oauth/cli.rb', line 19

def initialize(stdout, stdin, stderr, command, arguments)
  klass = get_command_class(parse_command(command))
  @command = klass.new(stdout, stdin, stderr, arguments)
  @help_command = HelpCommand.new(stdout, stdin, stderr, [])
end

Instance Method Details

#runObject



25
26
27
# File 'lib/oauth/cli.rb', line 25

def run
  @command.run
end