Implemented show help on ? key press #26
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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?