Move validation of CHEAT_HIGHLIGHT value to Configuration class

Method _check_configuration should be used for validating all bad
values from now on
This commit is contained in:
Tomas Korbar
2019-01-15 19:18:15 +01:00
parent 5eec6bf040
commit a2e028fd19
2 changed files with 14 additions and 11 deletions

View File

@ -46,16 +46,6 @@ 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')