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:
parent
79342a8411
commit
884d40ca16
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user