diff --git a/bin/actions/service.py b/bin/actions/service.py index 4a44825..e19dfd4 100755 --- a/bin/actions/service.py +++ b/bin/actions/service.py @@ -265,23 +265,15 @@ def main(): # Start command start_parser = subparsers.add_parser("start", help="Start a Docker service") - start_parser_group = start_parser.add_mutually_exclusive_group(required=True) - start_parser_group.add_argument( - "--all", action="store_true", help="Start all services" - ) - start_parser_group.add_argument("service", nargs="?", help="Service to start") + start_group = start_parser.add_mutually_exclusive_group(required=True) + start_group.add_argument("--all", action="store_true", help="Start all services") + start_group.add_argument("--service", dest="service", help="Service to start") # Stop command stop_parser = subparsers.add_parser("stop", help="Stop a Docker service") - 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", help="Service to stop") - - # Make one of the arguments required - stop_parser.set_defaults(service=None) - stop_parser_group.required = True + stop_group = stop_parser.add_mutually_exclusive_group(required=True) + stop_group.add_argument("--all", action="store_true", help="Stop all running services") + stop_group.add_argument("--service", dest="service", help="Service to stop") # Restart command restart_parser = subparsers.add_parser("restart", help="Restart a Docker service") @@ -292,11 +284,11 @@ def main(): "update", help="Update a Docker service (pull new images and recreate if needed)", ) - update_parser_group = update_parser.add_mutually_exclusive_group(required=True) - update_parser_group.add_argument( + update_group = update_parser.add_mutually_exclusive_group(required=True) + update_group.add_argument( "--all", action="store_true", help="Update all running services" ) - update_parser_group.add_argument("service", nargs="?", help="Service to update") + update_group.add_argument("--service", dest="service", help="Service to update") # PS command ps_parser = subparsers.add_parser("ps", help="Show Docker service status")