1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-15 16:59:09 +03:00

samba-tool: make --color a general option

We don't put --color into options.SambaOptions because we can't handle
the 'auto' case in the options module without knowing whether or not
self.outf is a tty, and a) this might not be resolved and b) is fiddly
to pass through.

The .use_colour class flag allows samba-tool subcommands to avoid having
--color, and is *also* useful in the short term for visualise and drs
commands to avoid having this --color clobber their own bespoke versions
(temporarily, during the transition).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall
2022-09-09 14:48:29 +12:00
committed by Andrew Bartlett
parent 4c623356ce
commit 5dd4696fb7
3 changed files with 12 additions and 0 deletions

View File

@ -92,6 +92,7 @@ class GraphCommand(Command):
}
takes_options = COMMON_OPTIONS + DOT_OPTIONS
takes_args = ()
use_colour = False
def get_db(self, H, sambaopts, credopts):
lp = sambaopts.get_loadparm()