From c15e83626888fc4c1440f6a6cc9548f7ba38e4b7 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Wed, 21 Aug 2013 22:56:33 -0400 Subject: [PATCH] Made it also necessary to set an environment variable in order to display colors to the terminal (in an effort to avoid an otherwise inevitable holy-war). --- cheat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheat b/cheat index 6d9bb97..a415ac7 100755 --- a/cheat +++ b/cheat @@ -6,7 +6,7 @@ DEFAULT_CHEAT_DIR = os.path.join(os.path.expanduser('~'), '.cheat') USE_PYGMENTS = False # NOTE remove this check if it is confirmed to work on windows -if os.name == 'posix': +if os.name == 'posix' and 'CHEATCOLORS' in os.environ: try: from pygments import highlight from pygments.util import ClassNotFound @@ -47,7 +47,7 @@ def cheat_files(cheat_directories): def main(): # assemble a keyphrase out of all params passed to the script - keyphrase = ' '.join(sys.argv[1:]) + keyphrase = ' '.join(sys.argv[1:]) cheat_dirs = cheat_directories() # verify that we have at least one cheat directory