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

Implemented show help on ? key press #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hrily
Copy link

@Hrily Hrily commented Oct 4, 2018

Fixes #16

I added this feature by using gnu readline's bind feature to map ? to press Enter. But I needed to differentiate normal Enter and ? Enter, so that I can reprint previous command in case of ?. So I mapped ? to some random string(which most probably won't be used in any command).

One problem with this feature is, it won't let us use ? in commands. I minimized this by showing help only when ? has space or no character before it.

Sample output:

root@dev:~# ?
Help:
           bash - No help provided
             ls - No help provided
           show - No help provided
            top - No help provided
root@dev:~# show ?
Help:
           disk - No help provided
root@dev:~# show 

I hope this solves the issue for you.

Also, I have no idea how we should test this feature. Can you provide me some insights on it?

@damrkul
Copy link

damrkul commented Oct 25, 2023

? is commonly used in cisco-like CLI's . Would really like to have that functionality in.

@italorossi italorossi self-assigned this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

capture key ? and show help without press enter
4 participants