summaryrefslogtreecommitdiff
path: root/src/xi.py
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2021-11-24 22:22:30 +0000
committerdavidovski <david@davidovski.xyz>2021-11-24 22:22:30 +0000
commit77b06090f69264bcc93911664bea2810cd4571ba (patch)
tree85f9b27f50de66fbcd9b47c01b8386f80aba769f /src/xi.py
parent52f1d6e6a5b0e0faca2d397114e107900b01b97d (diff)
cleaned a few things up
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="")