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
|
# File 'lib/oauth/cli/base_command.rb', line 3
def initialize(stdout, stdin, stderr, arguments)
@stdout, @stdin, @stderr = stdout, stdin, stderr
@options = {}
option_parser.parse!(arguments)
end
|
Instance Method Details
#required_options ⇒ Object
20
21
22
|
# File 'lib/oauth/cli/base_command.rb', line 20
def required_options
[]
end
|
#run ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/oauth/cli/base_command.rb', line 10
def run
missing = required_options - options.keys
if missing.empty?
_run
else
show_missing(missing)
puts option_parser.help
end
end
|