Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add history to the CLI #31

Open
EmileTrotignon opened this issue Feb 14, 2024 · 2 comments
Open

Add history to the CLI #31

EmileTrotignon opened this issue Feb 14, 2024 · 2 comments
Labels
good first issue Good for newcomers large

Comments

@EmileTrotignon
Copy link
Collaborator

When you use the CLI in toplevel mode :

$ sherlodoc search

You can type search queries and get results. However, you might want to type a query, and then modify it.
You can copy paste the query, but this is not very practical.

We should implement search history were you can access previous queries by using the up arrow key.

For now, I do not want to store the history between session, there is no need to write it to a file.

@EmileTrotignon EmileTrotignon added the good first issue Good for newcomers label Feb 14, 2024
@art-w
Copy link
Owner

art-w commented Feb 15, 2024

(In the mean time, I personally use the command rlwrap sherlodoc search which relies on the well-known(?) rlwrap utility to add line-edition and history to any program... so we could also document this trick in the readme :-°)

@EmileTrotignon
Copy link
Collaborator Author

I looked up which library would work well to implement this, as art-w told me the getting the arrows keypresses might be hard.

I found one : https://ocaml-community.github.io/lambda-term/3.1.0/lambda-term/LTerm/index.html, but it is indeed quite complicated to get keypresses, it also requires using Lwt, so I am bumping this to a large issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers large
Projects
None yet
Development

No branches or pull requests

2 participants