diff --git a/bin/cheat b/bin/cheat index 0e7fb7c..08ccaa6 100755 --- a/bin/cheat +++ b/bin/cheat @@ -37,10 +37,24 @@ Examples: # require the dependencies from cheat import sheets, sheet from cheat.utils import colorize +from cheat.utils import die from docopt import docopt +import os if __name__ == '__main__': + + # validate CHEAT_HIGHLIGHT values if set + colors = [ + 'grey' , 'red' , 'green' , 'yellow' , + 'blue' , 'magenta' , 'cyan' , 'white' , + ] + if ( + os.environ.get('CHEAT_HIGHLIGHT') and + os.environ.get('CHEAT_HIGHLIGHT') not in colors + ): + die("%s %s" %('CHEAT_HIGHLIGHT must be one of:', colors)) + # parse the command-line options options = docopt(__doc__, version='cheat 2.3.1')