From 35d161937e820b604cb4f2815d701fe900e4a6bb Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Wed, 3 May 2017 16:27:40 +0200 Subject: [PATCH] Added CLI error output when flag is not found --- luxafor/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/luxafor/cli.py b/luxafor/cli.py index 737c04b..39afb91 100644 --- a/luxafor/cli.py +++ b/luxafor/cli.py @@ -12,7 +12,11 @@ logger = logging.getLogger() def get_luxafor(): - return luxafor.Luxafor() + try: + return luxafor.Luxafor() + except BaseException: + click.secho('Luxafor flag not found.', fg='red') + sys.exit(1) def convert_hex_to_dec_color(hex_color: str) -> tuple: