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 03:38:21 UTC
[GitHub] [cassandra] pauloricardomg commented on a diff in pull request #1866: add HISTORY command to CQLSH
pauloricardomg commented on code in PR #1866:
URL: https://github.com/apache/cassandra/pull/1866#discussion_r973841876
##########
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:
maybe make `hisotry_length-50` configurable as an environment variable
##########
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()
Review Comment:
fix typo `hisotry_length` -> `history_length`
--
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