34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import argparse
|
|
import argcomplete
|
|
|
|
from cli.commands import commit, config, init, pull, push, show
|
|
|
|
|
|
def add_cli_args():
|
|
ap = argparse.ArgumentParser(
|
|
"archmgr",
|
|
description="A nixos-like declarative config and package manager for Arch Linux (or any other distro, with some tweaks)",
|
|
usage="archmgr [command] [options]",
|
|
)
|
|
ap.add_argument("-v", "--version", action="version", version="%(prog)s V0.0.1")
|
|
sp = ap.add_subparsers(
|
|
title="commands",
|
|
metavar="Use 'archmgr [command] --help' to see help for each command",
|
|
dest="cmd",
|
|
)
|
|
|
|
# ┌ ┐
|
|
# │ Subcommands │
|
|
# └ ┘
|
|
sp.add_parser("setup", help="Do initial setup, like installing required tools")
|
|
commit.add_parser(sp)
|
|
config.add_parser(sp)
|
|
init.add_parser(sp)
|
|
pull.add_parser(sp)
|
|
push.add_parser(sp)
|
|
show.add_parser(sp)
|
|
|
|
argcomplete.autocomplete(ap)
|
|
|
|
return ap.parse_args(), ap
|