diff options
author | davidovski <david@davidovski.xyz> | 2021-11-24 22:22:30 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2021-11-24 22:22:30 +0000 |
commit | 77b06090f69264bcc93911664bea2810cd4571ba (patch) | |
tree | 85f9b27f50de66fbcd9b47c01b8386f80aba769f /src/xi.py | |
parent | 52f1d6e6a5b0e0faca2d397114e107900b01b97d (diff) |
cleaned a few things up
Diffstat (limited to 'src/xi.py')
-rw-r--r-- | src/xi.py | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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="") |