]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: do not complain of no sub-command with '-V'
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 15 Jan 2025 02:07:38 +0000 (15:07 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 8 Feb 2025 02:33:38 +0000 (02:33 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
python/samba/netcmd/__init__.py
selftest/knownfail.d/samba-tool--version

index 2663d3d0cea976ef27a223e260ec2bad60497b75..3a0dfe1b3d0ee2ce6059bd3adfa11b09f7c0145e 100644 (file)
@@ -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):
index 4187c179dbc4c0d42a67a5344378ec4406ae129b..c2d5b044b14ab3acddfabb98ea8adda756306b65 100644 (file)
@@ -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\)