Skip to content

Conversation

@tleonhardt
Copy link
Member

This fixes a bug which occurred due to changes in recent versions of cmd2 and prevented this plugin from working at all.

Also:

  • Fixed unit tests and updated them to use StdSim

This closes #2

Also:
- Fixed unit tests and updated them to use StdSim
@tleonhardt tleonhardt added bug Something isn't working enhancement New feature or request labels Oct 15, 2018
@tleonhardt tleonhardt self-assigned this Oct 15, 2018
@leith-bartrich
Copy link

I can confirm that this fix does get my dependent code running again. It was failing for the reasons noted in the referenced issue. I can't speak to the unit testing changes. I was going to ask whether this issue suggested a problem with this plugin, or a problem with the changes to cmd2's help system. But the implied answer from the changes here, is that cmd2's changes were correct and the plugin simply needed to be pointed to the new function pointer. Looking forward to this being merged and released.

@tleonhardt
Copy link
Member Author

tleonhardt commented Oct 17, 2018

@leith-bartrich Thanks for confirming that this fixes your dependent code.

In general I would say that cmd2 changes much more rapidly than this plugin and occasionally changes in cmd2 might break the cmd2-submenu plugin. The cmd2 maintainers aren't exactly thrilled with the way the submenu feature is implemented in this plugin which is why the code was moved out of cmd2 proper. In a perfect world, we would re-implement this feature in a less invasive way which didn't involve nested cmd2.Cmd classes. However, we have day jobs and don't have the time for that. So we realize that submenus are a valuable feature for some end users and do intend to make sure this plugin still works.

That being said there may occasionally be compromises. For example, the fix in this PR is imperfect - it does fix the underlying bug, however it doesn't support tab-completion of subcommand names when getting help (which works properly in base cmd2). Fortunately, that is probably a pretty minor inconvenience for most end users.

In general, the cmd2 maintainers strongly prefer sub-commands over sub-menus, but we realize there is a time and a place for both.

I will work on getting this merged in now and hopefully get release done shortly.

@tleonhardt tleonhardt merged commit 1666a7d into master Oct 17, 2018
@tleonhardt tleonhardt deleted the fix_bugs branch October 17, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recent changes to complete_help in cmd2 appear to have broken the submenu plugin

3 participants