From baf7c5c585de35a01699a1b0e18bbb339c14afa0 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 9 Sep 2022 14:38:18 +1200 Subject: [PATCH] samba-tool: save --color choice for subcommands In particular, visualize needs it to decide colour for an output file that may or may not be stdout, so it needs to make its own decision for that file. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/netcmd/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index 94bb763e0d3..2b88c4cfbeb 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -85,6 +85,7 @@ class Command(object): hidden = False use_colour = True + requested_colour = None raw_argv = None raw_args = None @@ -235,6 +236,7 @@ class Command(object): "constants" in the colour module to be either real colours or empty strings. """ + self.requested_colour = requested try: colour.colour_if_wanted(self.outf, requested) except ValueError as e: -- 2.11.4.GIT