fix: update stop command parser to require a service argument
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 14s
Nix Format Check / check-format (push) Successful in 52s
Python Lint Check / check-python (push) Failing after 11s

This commit is contained in:
Menno van Leeuwen 2025-03-12 21:24:38 +01:00
parent 07dec180c7
commit f53297b17f
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -273,11 +273,15 @@ def main():
# Stop command
stop_parser = subparsers.add_parser("stop", help="Stop a Docker service")
stop_parser_group = stop_parser.add_mutually_exclusive_group(required=True)
stop_parser_group = stop_parser.add_mutually_exclusive_group(required=False)
stop_parser_group.add_argument(
"--all", action="store_true", help="Stop all running services"
)
stop_parser_group.add_argument("service", nargs="?", help="Service to stop")
stop_parser_group.add_argument("service", help="Service to stop")
# Make one of the arguments required
stop_parser.set_defaults(service=None)
stop_parser_group.required = True
# Restart command
restart_parser = subparsers.add_parser("restart", help="Restart a Docker service")