@@ -58,7 +58,7 @@ class Services < AbstractCommand
58
58
switch "--json" , description : "Output as JSON."
59
59
switch "--no-wait" , description : "Don't wait for `stop` to finish stopping the service."
60
60
conflicts "--max-wait=" , "--no-wait"
61
- named_args max : 2
61
+ named_args
62
62
end
63
63
64
64
sig { override . void }
@@ -93,14 +93,14 @@ def run
93
93
end
94
94
95
95
# Parse arguments.
96
- subcommand , formula , = args . named
96
+ subcommand , * formulae = args . named
97
97
98
98
no_named_formula_commands = [
99
99
*Homebrew ::Services ::Commands ::List ::TRIGGERS ,
100
100
*Homebrew ::Services ::Commands ::Cleanup ::TRIGGERS ,
101
101
]
102
102
if no_named_formula_commands . include? ( subcommand )
103
- raise UsageError , "The `#{ subcommand } ` subcommand does not accept a formula argument!" if formula
103
+ raise UsageError , "The `#{ subcommand } ` subcommand does not accept a formula argument!" if formulae . present?
104
104
raise UsageError , "The `#{ subcommand } ` subcommand does not accept the --all argument!" if args . all?
105
105
end
106
106
@@ -117,7 +117,7 @@ def run
117
117
end
118
118
end
119
119
120
- opoo "The --all argument overrides provided formula argument!" if formula . present? && args . all?
120
+ opoo "The --all argument overrides provided formula argument!" if formulae . present? && args . all?
121
121
122
122
targets = if args . all?
123
123
if subcommand == "start"
@@ -133,8 +133,8 @@ def run
133
133
else
134
134
Homebrew ::Services ::Formulae . available_services
135
135
end
136
- elsif formula
137
- [ Homebrew ::Services ::FormulaWrapper . new ( Formulary . factory ( formula ) ) ]
136
+ elsif formulae . present?
137
+ formulae . map { | formula | Homebrew ::Services ::FormulaWrapper . new ( Formulary . factory ( formula ) ) }
138
138
else
139
139
[ ]
140
140
end
0 commit comments