fix: update stop command parser to require a service argument
This commit is contained in:
parent
07dec180c7
commit
f53297b17f
@ -273,11 +273,15 @@ def main():
|
|||||||
|
|
||||||
# Stop command
|
# Stop command
|
||||||
stop_parser = subparsers.add_parser("stop", help="Stop a Docker service")
|
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(
|
stop_parser_group.add_argument(
|
||||||
"--all", action="store_true", help="Stop all running services"
|
"--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 command
|
||||||
restart_parser = subparsers.add_parser("restart", help="Restart a Docker service")
|
restart_parser = subparsers.add_parser("restart", help="Restart a Docker service")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user