38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
|
|
def test_apply_command(args):
|
|
print("DEBUG: test_apply_command started", flush=True)
|
|
print(f"Args: {args}", flush=True)
|
|
print("DEBUG: test_apply_command finished", flush=True)
|
|
|
|
def main():
|
|
print("DEBUG: Starting main()", flush=True)
|
|
|
|
parser = argparse.ArgumentParser()
|
|
subparsers = parser.add_subparsers(dest="cmd", required=True)
|
|
|
|
apply_parser = subparsers.add_parser("apply")
|
|
apply_parser.add_argument("--env")
|
|
apply_parser.add_argument("--kind")
|
|
apply_parser.add_argument("--db")
|
|
apply_parser.add_argument("--root", action="append")
|
|
apply_parser.add_argument("--manage-nfo", action="store_true")
|
|
apply_parser.add_argument("--dry-run", action="store_true")
|
|
apply_parser.add_argument("--live-on-miss", action="store_true")
|
|
|
|
print("DEBUG: Parser built", flush=True)
|
|
args = parser.parse_args()
|
|
print(f"DEBUG: Args parsed - cmd: {args.cmd}", flush=True)
|
|
|
|
if args.cmd == "apply":
|
|
print("DEBUG: Calling test_apply_command", flush=True)
|
|
test_apply_command(args)
|
|
print("DEBUG: test_apply_command returned", flush=True)
|
|
else:
|
|
parser.error("unknown command")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|