You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/09/19 04:51:27 UTC
[GitHub] [cassandra] larinachen commented on a diff in pull request #1866: add HISTORY command to CQLSH
larinachen commented on code in PR #1866:
URL: https://github.com/apache/cassandra/pull/1866#discussion_r973861053
##########
bin/cqlsh.py:
##########
@@ -1881,6 +1881,21 @@ def do_clear(self, parsed):
subprocess.call('clear', shell=True)
do_cls = do_clear
+ def do_history(self,parsed):
+ """
+ history/HIS
+
+ Displays the most recent (up to 50) commands executed in cqlsh.
+ """
+ recent_history = ""
+ hisotry_length = readline.get_current_history_length()
+ for index in range(hisotry_length, hisotry_length-50, -1):
Review Comment:
What about making history_length-50 configurable via an optional input parameter instead? This way, the user doesn't have to re-configure an environmental variable every time they want to view more/less. Let me know what you think about the input parameter approach vs the environmental variable approach!
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org