From: Douglas Bagnall Date: Wed, 15 Jan 2025 02:07:38 +0000 (+1300) Subject: samba-tool: do not complain of no sub-command with '-V' X-Git-Tag: tevent-0.17.0~856 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a408f06aeaceb22ea23f6f6e8118fb8e0490591;p=thirdparty%2Fsamba.git samba-tool: do not complain of no sub-command with '-V' BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770 Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton --- diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index 2663d3d0cea..3a0dfe1b3d0 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -427,7 +427,8 @@ class SuperCommand(Command): return (self, []) # We didn't find a subcommand, but maybe we found e.g. --version - print("%s: missing subcommand\n" % (path), file=self.outf) + if not deferred_args: + print("%s: missing subcommand\n" % (path), file=self.outf) return (self, deferred_args) def _run(self, *argv): diff --git a/selftest/knownfail.d/samba-tool--version b/selftest/knownfail.d/samba-tool--version index 4187c179dbc..c2d5b044b14 100644 --- a/selftest/knownfail.d/samba-tool--version +++ b/selftest/knownfail.d/samba-tool--version @@ -1,8 +1,6 @@ ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_help_version\(none\) ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_sub_command_version\(none\) -^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_version\(none\) ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_version_beats_help\(none\) ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_help_version\(fileserver\) ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_sub_command_version\(fileserver\) -^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_version\(fileserver\) ^samba\.tests\.samba_tool\.help\.samba\.tests\.samba_tool\.help\.HelpTestCase\.test_version_beats_help\(fileserver\)