From 4644416a92179f1f44ebcce90be1a058da4b3b30 Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Fri, 21 Jun 2019 13:12:01 +1200 Subject: samba-tool: Make the 'bytes' option type avaiable Allow samba tool to use the custom bytes option type. Option("--size", type="bytes", metavar="SIZE") To allow the input of file and memory sizes using unit suffixes i.e. 2Gb, 4KiB ... Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- python/samba/netcmd/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index 54e9107005a..57df46343e9 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -19,6 +19,7 @@ import optparse import samba from samba import colour +from samba.getopt import SambaOption from samba.logger import get_samba_logger from ldb import LdbError import sys @@ -26,7 +27,7 @@ import traceback import textwrap -class Option(optparse.Option): +class Option(SambaOption): SUPPRESS_HELP = optparse.SUPPRESS_HELP pass -- cgit v1.2.1