bitterfox commented on code in PR #4490:
URL: https://github.com/apache/hbase/pull/4490#discussion_r889869509


##########
hbase-shell/src/main/ruby/jar-bootstrap.rb:
##########
@@ -203,7 +203,10 @@ def debug?
 
 IRB.conf[:IRB_NAME] = 'hbase'
 IRB.conf[:AP_NAME] = 'hbase'
-IRB.conf[:PROMPT_MODE] = :CUSTOM
+if IRB.conf[:PROMPT_MODE] != :NULL

Review Comment:
   I'm not sure which is preferred. The behavior in this patch is similar to 
hbase 1.x hbase shell
   
   `if IRB.conf[:PROMPT_MODE] != :NULL`: no prompt for pipe or non interaction
   ```
   $ echo "balance_switch false" | bin/hbase shell
   HBase Shell
   Use "help" to get list of supported commands.
   Use "exit" to quit this interactive shell.
   For Reference, please visit: http://hbase.apache.org/book.html#shell
   Version 3.0.0-alpha-3-SNAPSHOT, ra712f9fa34ed3ace5ae6bf539c227a110b259a2c, 
Mon Jun  6 13:59:23 JST 2022
   Took 0.0020 seconds                                                          
                                                                                
               
   balance_switch false
   Previous balancer state : false                                              
                                                                                
               
   Took 0.9183 seconds                                                          
                                                                                
               
   false
   
   $ echo "balance_switch false" | bin/hbase shell -n
   balance_switch false
   Previous balancer state : false                                              
                                                                                
               
   Took 0.9745 seconds                                                          
                                                                                
               
   false
   
   ```
   
   `if interactive`: no prompt  non interaction only (similar behavior as hbase 
2.4.9)
   
   ```
   $ echo "balance_switch false" | bin/hbase shell
   HBase Shell
   Use "help" to get list of supported commands.
   Use "exit" to quit this interactive shell.
   For Reference, please visit: http://hbase.apache.org/book.html#shell
   Version 3.0.0-alpha-3-SNAPSHOT, ra712f9fa34ed3ace5ae6bf539c227a110b259a2c, 
Mon Jun  6 13:59:23 JST 2022
   Took 0.0023 seconds                                                          
                                                                                
               
   hbase:001:0> balance_switch false
   Previous balancer state : false                                              
                                                                                
               
   Took 1.0975 seconds                                                          
                                                                                
               
   => false
   hbase:002:0> 
   $ echo "balance_switch false" | bin/hbase shell -n
   balance_switch false
   Previous balancer state : false                                              
                                                                                
               
   Took 0.9643 seconds                                                          
                                                                                
               
   false
   
   ```
   
   Let me know which behavior is preferred



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