madrob commented on a change in pull request #4000:
URL: https://github.com/apache/hbase/pull/4000#discussion_r779203926



##########
File path: hbase-shell/src/main/ruby/jar-bootstrap.rb
##########
@@ -78,62 +78,59 @@ def add_to_configuration(c, arg)
   c
 end
 
+conf_from_cli = nil
+
+# strip out any config definitions that won't work with GetoptLong
+D_ARG = '-D'.freeze
+ARGV.delete_if do |arg|
+  if arg.start_with?(D_ARG) && arg.include?('=')
+    conf_from_cli = add_to_configuration(conf_from_cli, arg[2..-1])
+    true
+  else
+    false
+  end
+end
+
 opts = GetoptLong.new(
-  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
-  [ '--debug', '-d', GetoptLong::OPTIONAL_ARGUMENT ],
-  [ '--noninteractive', '-n', GetoptLong::OPTIONAL_ARGUMENT ],
-  [ '--top-level-defs', GetoptLong::OPTIONAL_ARGUMENT ],
-  [ '--Dkey=value', '-D', GetoptLong::NO_ARGUMENT ]
+  ['--help', '-h', GetoptLong::NO_ARGUMENT],
+  ['--debug', '-d', GetoptLong::NO_ARGUMENT],
+  ['--noninteractive', '-n', GetoptLong::NO_ARGUMENT],
+  ['--top-level-defs', GetoptLong::NO_ARGUMENT],
+  ['-D', GetoptLong::REQUIRED_ARGUMENT],
+  ['--return-values', '-r', GetoptLong::NO_ARGUMENT]
 )
+opts.ordering = GetoptLong::REQUIRE_ORDER

Review comment:
       Is this going to break back compat somewhere?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to