Class: OAuth::TTY::CLI — Documentation by YARD 0.9.45

# Class: OAuth::TTY::CLI

Inherits:
  Object
  - Object
  - OAuth::TTY::CLI
  show all

Defined in:
  lib/oauth/tty/cli.rb

## Constant Summary collapse

ALIASES =

      {
        "h" => "help",
        "v" => "version",
        "q" => "query",
        "a" => "authorize",
        "s" => "sign"
      }.freeze

## Class Method Summary collapse

- .puts_red(string) ⇒ Object

## Instance Method Summary collapse

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

  A new instance of CLI.

- #run ⇒ Object

## Constructor Details

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

Returns a new instance of CLI.

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

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

## Class Method Details

### .puts_red(string) ⇒ `Object`

    7
    8
    9
    # File 'lib/oauth/tty/cli.rb', line 7

    def puts_red(string)
      puts "\033[0;91m#{string}\033[0m"
    end

## Instance Method Details

### #run ⇒ `Object`

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

    def run
      @command.run
    end