File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 55require 'oauth/cli/authorize_command'
66require 'oauth/cli/sign_command'
77require 'oauth/cli/version_command'
8+ require 'active_support/core_ext/string/inflections'
89
910module OAuth
1011 class CLI
12+ def self . puts_red ( string )
13+ puts "\033 [0;91m#{ string } \033 [0m"
14+ end
15+
1116 ALIASES = {
1217 'h' => 'help' ,
1318 'v' => 'version' ,
@@ -43,6 +48,7 @@ def parse_command(command)
4348 when *ALIASES . values
4449 command
4550 else
51+ OAuth ::CLI . puts_red "Command '#{ command } ' not found"
4652 'help'
4753 end
4854 end
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def run
1212 if missing . empty?
1313 _run
1414 else
15- # puts "Options missing to OAuth CLI: #{options}"
15+ show_missing ( missing )
1616 puts option_parser . help
1717 end
1818 end
@@ -25,6 +25,11 @@ def required_options
2525
2626 attr_reader :options
2727
28+ def show_missing ( array )
29+ array = array . map { |s | "--#{ s } " } . join ( ' ' )
30+ OAuth ::CLI . puts_red "Options missing to OAuth CLI: #{ array } "
31+ end
32+
2833 def xmpp?
2934 options [ :xmpp ]
3035 end
You can’t perform that action at this time.
0 commit comments