maoling commented on a change in pull request #1180: ZOOKEEPER-3300 CLI 
"history" to show 10 commands
URL: https://github.com/apache/zookeeper/pull/1180#discussion_r358027400
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java
 ##########
 @@ -410,7 +410,7 @@ protected boolean processZKCmd(MyCommandOptions co) throws 
CliException, IOExcep
             history.put(commandCount, history.get(i));
             processCmd(cl);
         } else if (cmd.equals("history")) {
-            for (int i = commandCount - 10; i <= commandCount; ++i) {
+            for (int i = commandCount - 9; i <= commandCount; ++i) {
                 if (i < 0) {
 
 Review comment:
   Look at an example from linux cmd `history`, don't need to include the 
recent one: `history`
   `for (int i = commandCount - 10; i < commandCount; ++i)` ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to