feat(cli): Better organized CLI arg parsing

This commit is contained in:
2026-05-14 17:36:06 +02:00
parent e24eb647ca
commit 78eecfc81a
13 changed files with 109 additions and 46 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
from typing import cast
import cli.args as cliargs
import commands.commit as commit
@@ -9,7 +10,9 @@ import commands.init as init
import commands.pull as pull
import commands.push as push
import commands.prepare as setup
import commands.show as show
from config import load_config
from templates import ArchMgrTemplates
if __name__ == "__main__":
args, ap = cliargs.add_cli_args()
@@ -35,7 +38,7 @@ if __name__ == "__main__":
if args.cmd == "commit":
commit.commit(conf, args.force, args.no_render)
elif args.cmd == "config":
config.config(conf)
config.config(args, conf)
elif args.cmd == "init":
init.init(args.force)
elif args.cmd == "setup":
@@ -44,6 +47,8 @@ if __name__ == "__main__":
pull.pull(conf, args.rebase, args.apply)
elif args.cmd == "push":
push.push(args.force)
elif args.cmd == "show":
show.show(conf, cast(ArchMgrTemplates, {}), args)
except KeyboardInterrupt as e:
exit(130)
except Exception as e: