cli icon indicating copy to clipboard operation
cli copied to clipboard

Add SubMenu class

Open T0nd0Tara opened this issue 2 years ago • 1 comments

Let's say you have a rootMenu and a printMenu, I think it's weird to allow the user to enter a sub menu just for printing. I would just like to add multiple commands to the same printMenu for a cleaner code instead of adding commands like print a, print b

The sub menu can be inherited from Menu, and when you type help for example it'd look like that:

Commands available:
 - help
        This help message
 - exit
        Quit the session
 - print
        A custom menu message if exists
        - a
               This prints a
        - b
               This prints b

writing just print into the main Menu can result in printing an error / the sub menu help function

T0nd0Tara avatar Nov 18 '23 07:11 T0nd0Tara

Hi @T0nd0Tara ,

thank you for your contribution. I can't fully understand your suggestion, however. Are you proposing to display the entire subtree of the different submenus in the help message, as opposed to just the current menu? Or something else?

Thanks

daniele77 avatar Dec 01 '23 18:12 daniele77