mnpoonia commented on code in PR #8703:
URL: https://github.com/apache/hbase/pull/8703#discussion_r4107498799


##########
bin/hbase:
##########
@@ -795,6 +851,40 @@ elif [ "$COMMAND" = "credential" ] ; then
   CLASS='org.apache.hadoop.security.alias.CredentialShell'
 elif [ "$COMMAND" = "copyreppeers" ] ; then
   CLASS='org.apache.hadoop.hbase.replication.CopyReplicationPeers'
+elif [[ "$COMMAND" == *.jsh ]] ; then
+  # No JDK version guard here: hbase-config.sh already requires JDK 17+.
+  resolve_bin_script "$COMMAND" "jshell script"
+  JSH_SCRIPT="$RESOLVED_BIN_SCRIPT"
+  # pass positional args to the script via env vars: jshell script mode has no
+  # String[] args equivalent, and re-joining/re-splitting args into one string
+  # breaks on embedded spaces, so each arg gets its own env var instead.
+  # See HBASE_JSH_ARG_N / HBASE_JSH_ARG_COUNT in the header and 
hbase_startup.jsh.
+  i=0
+  for a in "$@"; do
+    export HBASE_JSH_ARG_$i="$a"
+    i=$((i+1))
+  done
+  export HBASE_JSH_ARG_COUNT=$i
+  set --
+  CLASS='jdk.internal.jshell.tool.JShellToolProvider'
+  init_jshell_args
+  JSHELL_ARGS+=(-q "$JSH_SCRIPT")

Review Comment:
   Good catch — confirmed: jshell exits 1 with `Only one feedback option 
(--feedback, -q, -s, or -v) may be used.` when `-q` is appended on top of a 
user `--feedback` from `HBASE_JSHELL_ARGS`.
   
   Fixed in the latest push: script mode only defaults to `-q` when none of 
`--feedback` / `-q` / `-s` / `-v` is already set.



-- 
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