From 77b06090f69264bcc93911664bea2810cd4571ba Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 24 Nov 2021 22:22:30 +0000 Subject: cleaned a few things up --- src/xi.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/xi.py') diff --git a/src/xi.py b/src/xi.py index f6089ec..aa819b4 100644 --- a/src/xi.py +++ b/src/xi.py @@ -1,5 +1,7 @@ import options import config +import util +import colors from verbs.sync import sync from verbs.install import install @@ -25,14 +27,21 @@ def main(): options.print_usage() return + conf = config.parse_file(opts["c"]) if len(args) > 0: verb = args[0].lower() - ( - verbs[verb] if verb in verbs else search - )( - args[1:] if len(args) > 1 else [], opts, conf - ) + + try: + ( + verbs[verb] if verb in verbs else search + )( + args[1:] if len(args) > 1 else [], opts, conf + ) + except KeyboardInterrupt: + print(colors.RESET + colors.CLEAR_LINE + colors.RED + "Action cancelled by user") else: options.print_usage() return + + print(colors.RESET + colors.CLEAR_LINE, end="") -- cgit v1.2.1