68
68
-h | --help This help.
69
69
-n | --noninteractive Do not run within an IRB session and exit with non-zero
70
70
status on first error.
71
+ -c | --colorize Enable colorized output.
72
+ -a | --autocomplete Enable auto-completion.
71
73
--top-level-defs Compatibility flag to export HBase shell commands onto
72
74
Ruby's main object
73
75
-Dkey=value Pass hbase-*.xml Configuration overrides. For example, to
@@ -105,6 +107,8 @@ def add_to_configuration(c, arg)
105
107
[ '--help' , '-h' , GetoptLong ::NO_ARGUMENT ] ,
106
108
[ '--debug' , '-d' , GetoptLong ::NO_ARGUMENT ] ,
107
109
[ '--noninteractive' , '-n' , GetoptLong ::NO_ARGUMENT ] ,
110
+ [ '--colorize' , '-c' , GetoptLong ::NO_ARGUMENT ] ,
111
+ [ '--autocomplete' , '-a' , GetoptLong ::NO_ARGUMENT ] ,
108
112
[ '--top-level-defs' , GetoptLong ::NO_ARGUMENT ] ,
109
113
[ '-D' , GetoptLong ::REQUIRED_ARGUMENT ] ,
110
114
[ '--return-values' , '-r' , GetoptLong ::NO_ARGUMENT ]
@@ -115,6 +119,8 @@ def add_to_configuration(c, arg)
115
119
log_level = 'ERROR'
116
120
@shell_debug = false
117
121
interactive = true
122
+ colorize = false
123
+ autocomplete = false
118
124
full_backtrace = false
119
125
top_level_definitions = false
120
126
@@ -132,6 +138,10 @@ def add_to_configuration(c, arg)
132
138
puts 'Setting DEBUG log level...'
133
139
when '--noninteractive'
134
140
interactive = false
141
+ when '--colorize'
142
+ colorize = true
143
+ when '--autocomplete'
144
+ autocomplete = true
135
145
when '--return-values'
136
146
warn '[INFO] the -r | --return-values option is ignored. we always behave ' \
137
147
'as though it was given.'
@@ -213,6 +223,8 @@ def debug?
213
223
IRB . conf [ :AP_NAME ] = 'hbase'
214
224
IRB . conf [ :PROMPT_MODE ] = :CUSTOM
215
225
IRB . conf [ :BACK_TRACE_LIMIT ] = 0 unless full_backtrace
226
+ IRB . conf [ :USE_AUTOCOMPLETE ] = autocomplete
227
+ IRB . conf [ :USE_COLORIZE ] = colorize
216
228
217
229
# Create a workspace we'll use across sessions.
218
230
workspace = @shell . get_workspace
0 commit comments