-
Notifications
You must be signed in to change notification settings - Fork 55
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
Remove commands without code blocks #70
Conversation
If this recursive pruning of the command tree is an acceptable solution. I can add a few test cases and fix ones that conflict with this change. |
@twitu thanks for the PR! I like the solution, it's very clean 👍 If you can add some tests, that would be great. Also looks like one test is failing, |
I have modified two test cases to fit pruning of commands. However there are also three tests in Also I have a question regarding additional tests. Should I write tests that simulate user input or ones that simply check the |
This is a design decision. It is possible that the user might have missed giving the executor for a command. In such a case it is better to retain the command and provide a helpful error message indicating the problem. Telling the user that the executor is missing is better than saying the command does not exist (because it has been pruned)
@twitu this is great! I'll get a new version released soon. |
I'll release this after I figure out this #64 👍 |
Which issue does this fix?
Closes #65
Describe the solution
Recursively remove commands that do not have any code block and have no subcommands. Retain root level command with
level == 1
.