Closed twitu closed 4 years ago
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, does_not_add_verbose_optional_flag_to_command_with_no_script
but we can delete that test as it's no longer needed with this fix.
I have modified two test cases to fit pruning of commands. However there are also three tests in subcommands_test.rs
that are failing. I am not sure if these tests are relevant any longer. How to handle them?
Also I have a question regarding additional tests. Should I write tests that simulate user input or ones that simply check the command_tree
structure for retained commands? Also which file is the most appropriate place to put these tests?
@twitu this is great! I'll get a new version released soon.
I'll release this after I figure out this https://github.com/jakedeichert/mask/pull/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
.