diff --git a/catcli/catcli.py b/catcli/catcli.py index 1faf383..d5adf00 100755 --- a/catcli/catcli.py +++ b/catcli/catcli.py @@ -36,15 +36,15 @@ USAGE = """ {0} Usage: - {1} ls [--catalog=] [-aBrVS] [] - {1} index [--catalog=] [--meta=...] [-aBcfnV] - {1} update [--catalog=] [-aBcfnV] [--lpath=] - {1} find [--catalog=] [-aBbdVP] [--path=] - {1} rm [--catalog=] [-BfV] - {1} tree [--catalog=] [-aBVS] [] - {1} rename [--catalog=] [-BfV] - {1} edit [--catalog=] [-BfV] - {1} graph [--catalog=] [-BV] [] + {1} ls [--catalog=] [-aBCrVS] [] + {1} index [--catalog=] [--meta=...] [-aBCcfnV] + {1} update [--catalog=] [-aBCcfnV] [--lpath=] + {1} find [--catalog=] [-aBCbdVP] [--path=] + {1} rm [--catalog=] [-BCfV] + {1} tree [--catalog=] [-aBCVS] [] + {1} rename [--catalog=] [-BCfV] + {1} edit [--catalog=] [-BCfV] + {1} graph [--catalog=] [-BCV] [] {1} help {1} --help {1} --version @@ -55,6 +55,7 @@ Options: -a --archive Handle archive file [default: False]. -B --no-banner Do not display the banner [default: False]. -b --script Output script to manage found file(s) [default: False]. + -C --no-color Do not output colors [default: False]. -c --hash Calculate md5 hash [default: False]. -d --directory Only directory (default: False). -f --force Do not ask when updating the catalog [default: False]. @@ -236,6 +237,10 @@ def main(): if not args['--no-banner']: banner() + # set colors + if args['--no-color']: + Logger.no_color() + # init noder noder = Noder(debug=args['--verbose'], sortsize=args['--sortsize'], arc=args['--archive']) diff --git a/catcli/logger.py b/catcli/logger.py index 64ded23..8e07073 100644 --- a/catcli/logger.py +++ b/catcli/logger.py @@ -26,8 +26,18 @@ class Logger: ARCHIVE = 'archive' NBFILES = 'nbfiles' - def __init__(self): - pass + def no_color(): + Logger.RED = '' + Logger.GREEN = '' + Logger.YELLOW = '' + Logger.PURPLE = '' + Logger.BLUE = '' + Logger.GRAY = '' + Logger.MAGENTA = '' + Logger.RESET = '' + Logger.EMPH = '' + Logger.BOLD = '' + Logger.UND = '' ###################################################################### # node specific output