]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: stick to the point with --version
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 1 Jun 2021 00:48:24 +0000 (00:48 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 10 Jun 2021 00:29:32 +0000 (00:29 +0000)
We were doing this:

    $ bin/samba-tool --version
    samba-tool: no such subcommand: --version

    4.15.0pre1-DEVELOPERBUILD
    $

which is silly. Now we'll just see the version.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/netcmd/__init__.py

index 620e3751e7f486556748385a126578bc1685319b..62fe1380d5298cd5f331fe74b6ae8ebec7da7beb 100644 (file)
@@ -234,7 +234,7 @@ class SuperCommand(Command):
         if subcommand in self.subcommands:
             return self.subcommands[subcommand]._run(
                 "%s %s" % (myname, subcommand), *args)
-        elif subcommand not in [ '--help', 'help', None ]:
+        elif subcommand not in [ '--help', 'help', None, '-h', '-V', '--version' ]:
             print("%s: no such subcommand: %s\n" % (myname, subcommand))
             args = []