[ 
https://issues.apache.org/jira/browse/CASSANDRA-15046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724429#comment-17724429
 ] 

Stefan Miklosovic edited comment on CASSANDRA-15046 at 5/19/23 10:14 PM:
-------------------------------------------------------------------------

[~bschoeni] thanks for the patch.

I tried it and what I would change is the order. Can not we reverse the output? 
history command on Linux gives you the latest commands at the bottom. This 
solution place them on top so the oldest is on the bottom. Also, Linux history 
prints numbers like this:

{code}
 ...
 2001  date
 2002  ls
 2003  df -h
{code}

I would focus on the reverse order first so we have the latest command on the 
bottom and we do not need to scroll up to see them.

Numbering of lines would be cool too, but if it ends up being too complicated 
let it be like it is. What I like about numbering is that people may reference 
to it. For example in bash, if you do "history" and you do this in bash:

{code}
user$ !2003
{code}

It will execute "df -h" again. 

This would be super cool to have because we do not need to copy it, we can just 
reference what command we want to re-execute. Maybe that would be possible too?

I looked into numbering the lines and it does not seem to be overly complicated.


was (Author: smiklosovic):
[~bschoeni] thanks for the patch.

I tried it and what I would change is the order. Can not we reverse the output? 
history command on Linux gives you the latest commands at the bottom. This 
solution place them on top so the oldest is on the bottom. Also, Linux history 
prints numbers like this:

{code}
 ...
 2001  date
 2002  ls
 2003  df -h
{code}

I would focus on the reverse order first so we have the latest command on the 
bottom and we do not need to scroll up to see them.

Numbering of lines would be cool too, but if it ends up being too complicated 
let it be like it is.

> Add a "history" command to cqlsh.  Perhaps "show history"?
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-15046
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15046
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Interpreter
>            Reporter: Wes Peters
>            Assignee: Brad Schoening
>            Priority: Low
>              Labels: lhf
>             Fix For: 5.x
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> I was trying to capture some create key space and create table commands from 
> a running cqlsh, and found there was no equivalent to the '\s' history 
> command in Postgres' psql shell.  It's a great tool for figuring out what you 
> were doing yesterday.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to