diff options
author | Philip Hallstrom <philip@pjkh.com> | 2018-10-06 16:08:26 -0700 |
---|---|---|
committer | Philip Hallstrom <philip@pjkh.com> | 2018-10-06 16:08:26 -0700 |
commit | a22d980cdfc31718e28b5ba00b135e4396698660 (patch) | |
tree | 8e69dbce24fb7510d04e631ebcb25c1e0bd38b86 /dotbot/cli.py | |
parent | f197ededb11e7613aa0f4c5f88311e9ab4653749 (diff) |
Add option --no-color to suppress colorization of output
By default, if output is a TTY, dotbot will colorize the output. This
patch adds the option to pass `--no-color` to dotbot to have it suppress
this colorization.
Diffstat (limited to 'dotbot/cli.py')
-rw-r--r-- | dotbot/cli.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dotbot/cli.py b/dotbot/cli.py index aec6097..fdc2a13 100644 --- a/dotbot/cli.py +++ b/dotbot/cli.py @@ -28,6 +28,8 @@ def add_options(parser): action='store_true', help='disable built-in plugins') parser.add_argument('--plugin-dir', action='append', dest='plugin_dirs', default=[], metavar='PLUGIN_DIR', help='load all plugins in PLUGIN_DIR') + parser.add_argument('--no-color', dest='no_color', action='store_true', + help='disable color output') parser.add_argument('--version', action='store_true', help='show program\'s version number and exit') @@ -50,6 +52,8 @@ def main(): log.set_level(Level.INFO) if options.verbose: log.set_level(Level.DEBUG) + if options.no_color: + log.use_color(False) plugin_directories = list(options.plugin_dirs) if not options.disable_built_in_plugins: from .plugins import Clean, Link, Shell |