Class: OAuth::CLI::BaseCommand
- Inherits:
-
Object
- Object
- OAuth::CLI::BaseCommand
show all
- Defined in:
- lib/oauth/cli/base_command.rb
Instance Method Summary
collapse
Constructor Details
#initialize(stdout, stdin, stderr, arguments) ⇒ BaseCommand
3
4
5
6
7
8
9
10
|
# File 'lib/oauth/cli/base_command.rb', line 3
def initialize(stdout, stdin, stderr, arguments)
@stdout = stdout
@stdin = stdin
@stderr = stderr
@options = {}
option_parser.parse!(arguments)
end
|
Instance Method Details
#required_options ⇒ Object
22
23
24
|
# File 'lib/oauth/cli/base_command.rb', line 22
def required_options
[]
end
|
#run ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/oauth/cli/base_command.rb', line 12
def run
missing = required_options - options.keys
if missing.empty?
_run
else
show_missing(missing)
puts option_parser.help
end
end
|