mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-16 05:49:59 -05:00
fix: handle ctrl+c/d cleanly
Also add newline before pause prompt
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
from caelestia.parser import parse_args
|
||||
from caelestia.utils.io import log
|
||||
from caelestia.utils.version import print_version
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser, args = parse_args()
|
||||
if args.version:
|
||||
print_version()
|
||||
elif "cls" in args:
|
||||
args.cls(args).run()
|
||||
else:
|
||||
parser.print_help()
|
||||
try:
|
||||
parser, args = parse_args()
|
||||
if args.version:
|
||||
print_version()
|
||||
elif "cls" in args:
|
||||
args.cls(args).run()
|
||||
else:
|
||||
parser.print_help()
|
||||
except KeyboardInterrupt:
|
||||
log("Exiting...")
|
||||
|
||||
Reference in New Issue
Block a user