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

script: Fix crash when help called with unknown command #28

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

joamaki
Copy link
Contributor

@joamaki joamaki commented Dec 3, 2024

'help some-unknown-command' crashed as ListCmds wasn't checking if the command was actually found from the commands map.

While at it, make the 'help' a bit more useful by allowing filtering of commands with a regexp.

'help some-unknown-command' crashed as ListCmds wasn't checking
if the command was actually found from the commands map.

Signed-off-by: Jussi Maki <[email protected]>
Filter the commands shown by 'help' with a regexp instead
of searching by name. This will become useful when there are
many commands sharing the same prefix, for example StateDB has
11 commands and with this we can dump the help for all of them with
'help ^db'.

Signed-off-by: Jussi Maki <[email protected]>
@joamaki joamaki requested a review from a team as a code owner December 3, 2024 11:29
@joamaki joamaki requested review from dylandreimerink and removed request for a team December 3, 2024 11:29
Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joamaki joamaki merged commit 4ba0771 into main Dec 3, 2024
1 check passed
@joamaki joamaki deleted the pr/joamaki/fix-help branch December 3, 2024 13:55
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.

2 participants