ishell
ishell copied to clipboard
Implemented show help on ? key press
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?
? is commonly used in cisco-like CLI's . Would really like to have that functionality in.