File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1549,6 +1549,23 @@ def main():
15491549 "vmm_id" , help = "VMM instance ID (prefix match supported)"
15501550 )
15511551
1552+ # Register nested subcommands for top-level help display
1553+ _nested_commands = {
1554+ 'vmm ls' : 'List all running VMM instances on this host' ,
1555+ 'vmm switch' : 'Switch active VMM instance' ,
1556+ }
1557+
1558+ # Patch parser's format_help to show nested subcommands
1559+ _orig_format_help = parser .format_help
1560+ def _patched_format_help ():
1561+ text = _orig_format_help ()
1562+ # Append nested subcommands after the subparser listing
1563+ extra = "\n nested commands:\n "
1564+ for cmd , desc in _nested_commands .items ():
1565+ extra += f" { cmd :<24s} { desc } \n "
1566+ return text + extra
1567+ parser .format_help = _patched_format_help
1568+
15521569 # List command
15531570 lsvm_parser = subparsers .add_parser ("lsvm" , help = "List VMs" )
15541571 lsvm_parser .add_argument (
You can’t perform that action at this time.
0 commit comments