1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

samba-tool: don't error if there are no sub-commands

This is useful when you commit samba-tool tests before you commit the
samba-tool code, and you want the tests to fail rather than error.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2024-02-29 16:29:30 +13:00 committed by Andrew Bartlett
parent 79342a8411
commit 884d40ca16

View File

@ -428,7 +428,7 @@ class SuperCommand(Command):
epilog = "\nAvailable subcommands:\n"
subcmds = sorted(self.subcommands.keys())
max_length = max([len(c) for c in subcmds])
max_length = max([len(c) for c in subcmds], default=0)
for cmd_name in subcmds:
cmd = self.subcommands[cmd_name]
if cmd.hidden: