mirror of
https://github.com/samba-team/samba.git
synced 2025-12-14 20:23:54 +03:00
py:get_opts:VersionOptions prints version in --help
Because it might as well. Like this:
Version Options:
-V, --version Display version number (4.22.2)
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>
This commit is contained in:
committed by
Douglas Bagnall
parent
a61e192f25
commit
6f7bc5cb12
@@ -32,6 +32,7 @@ from samba.credentials import (
|
||||
MUST_USE_KERBEROS,
|
||||
)
|
||||
from samba._glue import get_burnt_commandline
|
||||
import samba
|
||||
|
||||
|
||||
def check_bytes(option, opt, value):
|
||||
@@ -310,10 +311,9 @@ class VersionOptions(OptionGroup):
|
||||
super().__init__(parser, "Version Options")
|
||||
self.add_option("-V", "--version", action="callback",
|
||||
callback=self._display_version,
|
||||
help="Display version number")
|
||||
help=f"Display version number ({samba.version})")
|
||||
|
||||
def _display_version(self, option, opt_str, arg, parser):
|
||||
import samba
|
||||
print(samba.version)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user