fix: no importing, catch errors, ascii art

This commit is contained in:
2026-04-10 08:59:35 +02:00
parent 711b89a0d6
commit ead9e3a3f7
3 changed files with 39 additions and 42 deletions

View File

@@ -6,33 +6,40 @@ import commands.init as init
import commands.pull as pull
import commands.push as push
args, ap = cliargs.add_cli_args()
if args.cmd == None:
ap.print_help()
print("\nSpecify a subcommand, '-h' or '-v'")
exit(64)
if __name__ == "__main__":
args, ap = cliargs.add_cli_args()
print(
"""
_
( )
_ _ _ __ ___| |__ ___ ___ __ _ __
/ _ ) __)/ ___) _ \\ _ _ \\/ _ \\ __)
( (_| | | ( (___| | | | ( ) ( ) | (_) | |
\\__ _)_) \\____)_) (_)_) (_) (_)\\__ |_)
( )_) |
\\___/
"""
)
if args.cmd == None:
ap.print_help()
print("\nSpecify a subcommand, '-h' or '-v'")
exit(64)
if args.cmd == "commit":
commit.commit(args.dry_run, args.force, args.no_commit)
elif args.cmd == "config":
config.config()
elif args.cmd == "init":
init.init(args.force)
elif args.cmd == "pull":
pull.pull(args.rebase, args.apply)
elif args.cmd == "push":
push.push(args.force)
print(
"""
_
( )
_ _ _ __ ___| |__ ___ ___ __ _ __
/ _ ) __)/ ___) _ \\ _ _ \\/ _ \\ __)
( (_| | | ( (___| | | | ( ) ( ) | (_) | |
\\__ _)_) \\____)_) (_)_) (_) (_)\\__ |_)
( )_) |
\\___/
"""
)
try:
if args.cmd == "commit":
commit.commit(args.dry_run, args.force, args.no_render)
elif args.cmd == "config":
config.config()
elif args.cmd == "init":
init.init(args.force)
elif args.cmd == "pull":
pull.pull(args.rebase, args.apply)
elif args.cmd == "push":
push.push(args.force)
except KeyboardInterrupt as e:
exit(130)
except Exception as e:
raise e