summaryrefslogtreecommitdiff
path: root/src/xi.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/xi.py')
-rw-r--r--src/xi.py19
1 files changed, 14 insertions, 5 deletions
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="")