ishell icon indicating copy to clipboard operation
ishell copied to clipboard

Implemented show help on ? key press

Open Hrily opened this issue 6 years ago • 1 comments

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?

Hrily avatar Oct 04 '18 22:10 Hrily

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

damrkul avatar Oct 25 '23 15:10 damrkul