deploy: refactor main

This commit is contained in:
Sean Buckley 2023-03-23 15:38:34 -04:00
parent e2366bb7e2
commit 6a47d36303

View file

@ -156,19 +156,20 @@ def rexec(hosts, cmd):
def main(): def main():
op = argv[1] op = argv[1]
args = argv[2:] hosts = expand(argv[2])
args = argv[3:]
if op in ["boot", "switch", "test"]: if op in ["boot", "switch", "test"]:
apply(op, expand(args[0])) apply(op, hosts)
elif op == "check": elif op == "check":
check(expand(args[0])) check(hosts)
elif op == "push": elif op == "push":
push(expand(args[0])) push(hosts)
elif op == "exec": elif op == "exec":
rexec(expand(args[0]), args[1:]) rexec(hosts, args)
else: else:
print("Invalid op:", op) print("Invalid op:", op)