diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..92cbf7e --- /dev/null +++ b/src/main.py @@ -0,0 +1,32 @@ +import argparse +import sys + +__VERSION__ = "1.0.0" + + +def main() -> int: + # parse cli args + arg_parser = argparse.ArgumentParser( + prog="neb", + description="Nebula, the package manager for the Comet programming language.", + epilog="Version " + __VERSION__ + ) + sub_parsers = arg_parser.add_subparsers(dest="cmd") + + # install command + install_cmd = sub_parsers.add_parser(name="install", description="install a rock (package)") + install_cmd.add_argument("names", help="name of the rocks to install", nargs="+") + install_cmd.add_argument("--max-retries", help="max number of download retries before giving up", type=int, default=3) + + args = arg_parser.parse_args() + + if not args.cmd: + arg_parser.print_help() + return 0 + + # really feeling like a C programmer lmao + return 0 + + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file