Skip to content

Commit 468d466

Browse files
cmd/services: manpage fixes
1 parent 12e4c8a commit 468d466

File tree

4 files changed

+39
-41
lines changed

4 files changed

+39
-41
lines changed

Library/Homebrew/cmd/services.rb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ class Services < AbstractCommand
2525
If `sudo` is passed, operate on `/Library/LaunchDaemons` or `/usr/lib/systemd/system` (started at boot).
2626
Otherwise, operate on `~/Library/LaunchAgents` or `~/.config/systemd/user` (started at login).
2727
28-
[`sudo`] `brew services` [`list`] (`--json`) (`--debug`):
28+
[`sudo`] `brew services` [`list`] [`--json`] [`--debug`]:
2929
List information about all managed services for the current user (or root).
3030
Provides more output from Homebrew and `launchctl`(1) or `systemctl`(1) if run with `--debug`.
3131
32-
[`sudo`] `brew services info` (<formula>|`--all`|`--json`):
32+
[`sudo`] `brew services info` (<formula>|`--all`) [`--json`]:
3333
List all managed services for the current user (or root).
3434
35-
[`sudo`] `brew services run` (<formula>|`--all`|`--file=`):
35+
[`sudo`] `brew services run` (<formula>|`--all`) [`--file=`]:
3636
Run the service <formula> without registering to launch at login (or boot).
3737
38-
[`sudo`] `brew services start` (<formula>|`--all`|`--file=`):
38+
[`sudo`] `brew services start` (<formula>|`--all`) [`--file=`]:
3939
Start the service <formula> immediately and register it to launch at login (or boot).
4040
41-
[`sudo`] `brew services stop` (`--keep`) (`--no-wait`|`--max-wait=`) (<formula>|`--all`):
41+
[`sudo`] `brew services stop` [`--keep`] [`--no-wait`|`--max-wait=`] (<formula>|`--all`):
4242
Stop the service <formula> immediately and unregister it from launching at login (or boot),
4343
unless `--keep` is specified.
4444
4545
[`sudo`] `brew services kill` (<formula>|`--all`):
4646
Stop the service <formula> immediately but keep it registered to launch at login (or boot).
4747
48-
[`sudo`] `brew services restart` (<formula>|`--all`|`--file=`):
48+
[`sudo`] `brew services restart` (<formula>|`--all`) [`--file=`]:
4949
Stop (if necessary) and start the service <formula> immediately and register it to launch at login (or boot).
5050
5151
[`sudo`] `brew services cleanup`:
@@ -58,15 +58,16 @@ class Services < AbstractCommand
5858
flag "--max-wait=",
5959
description: "Wait at most this many seconds for `stop` to finish stopping a service. " \
6060
"Defaults to 60. Set this to zero (0) seconds to wait indefinitely."
61-
switch "--all",
62-
description: "Run <subcommand> on all services."
63-
switch "--json",
64-
description: "Output as JSON."
6561
switch "--no-wait",
6662
description: "Don't wait for `stop` to finish stopping the service."
6763
switch "--keep",
6864
description: "When stopped, don't unregister the service from launching at login (or boot)."
65+
switch "--all",
66+
description: "Run <subcommand> on all services."
67+
switch "--json",
68+
description: "Output as JSON."
6969

70+
conflicts "--all", "--file"
7071
conflicts "--max-wait=", "--no-wait"
7172

7273
named_args %w[list info run start stop kill restart cleanup]
@@ -123,9 +124,6 @@ def run
123124
]
124125
if file_commands.exclude?(subcommand)
125126
raise UsageError, "The `#{subcommand}` subcommand does not accept the `--file=` argument!"
126-
elsif args.all?
127-
raise UsageError,
128-
"The `#{subcommand}` subcommand does not accept the `--all` and `--file=` arguments at the same time!"
129127
end
130128
end
131129

completions/zsh/_brew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,9 +1909,9 @@ _brew_search() {
19091909
# brew services
19101910
_brew_services() {
19111911
_arguments \
1912-
'--all[Run subcommand on all services]' \
1912+
'(--file)--all[Run subcommand on all services]' \
19131913
'--debug[Display any debugging information]' \
1914-
'--file[Use the service file from this location to `start` the service]' \
1914+
'(--all)--file[Use the service file from this location to `start` the service]' \
19151915
'--help[Show this message]' \
19161916
'--json[Output as JSON]' \
19171917
'--keep[When stopped, don'\''t unregister the service from launching at login (or boot)]' \

docs/Manpage.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,26 +1411,26 @@ If `sudo` is passed, operate on `/Library/LaunchDaemons` or
14111411
`/usr/lib/systemd/system` (started at boot). Otherwise, operate on
14121412
`~/Library/LaunchAgents` or `~/.config/systemd/user` (started at login).
14131413

1414-
\[`sudo`\] `brew services` \[`list`\] (`--json`) (`--debug`)
1414+
\[`sudo`\] `brew services` \[`list`\] \[`--json`\] \[`--debug`\]
14151415

14161416
: List information about all managed services for the current user (or root).
14171417
Provides more output from Homebrew and `launchctl`(1) or `systemctl`(1) if run
14181418
with `--debug`.
14191419

1420-
\[`sudo`\] `brew services info` (*`formula`*\|`--all`\|`--json`)
1420+
\[`sudo`\] `brew services info` (*`formula`*\|`--all`) \[`--json`\]
14211421

14221422
: List all managed services for the current user (or root).
14231423

1424-
\[`sudo`\] `brew services run` (*`formula`*\|`--all`\|`--file=`)
1424+
\[`sudo`\] `brew services run` (*`formula`*\|`--all`) \[`--file=`\]
14251425

14261426
: Run the service *`formula`* without registering to launch at login (or boot).
14271427

1428-
\[`sudo`\] `brew services start` (*`formula`*\|`--all`\|`--file=`)
1428+
\[`sudo`\] `brew services start` (*`formula`*\|`--all`) \[`--file=`\]
14291429

14301430
: Start the service *`formula`* immediately and register it to launch at login
14311431
(or boot).
14321432

1433-
\[`sudo`\] `brew services stop` (`--keep`) (`--no-wait`\|`--max-wait=`) (*`formula`*\|`--all`)
1433+
\[`sudo`\] `brew services stop` \[`--keep`\] \[`--no-wait`\|`--max-wait=`\] (*`formula`*\|`--all`)
14341434

14351435
: Stop the service *`formula`* immediately and unregister it from launching at
14361436
login (or boot), unless `--keep` is specified.
@@ -1440,7 +1440,7 @@ If `sudo` is passed, operate on `/Library/LaunchDaemons` or
14401440
: Stop the service *`formula`* immediately but keep it registered to launch at
14411441
login (or boot).
14421442

1443-
\[`sudo`\] `brew services restart` (*`formula`*\|`--all`\|`--file=`)
1443+
\[`sudo`\] `brew services restart` (*`formula`*\|`--all`) \[`--file=`\]
14441444

14451445
: Stop (if necessary) and start the service *`formula`* immediately and register
14461446
it to launch at login (or boot).
@@ -1462,14 +1462,6 @@ If `sudo` is passed, operate on `/Library/LaunchDaemons` or
14621462
: Wait at most this many seconds for `stop` to finish stopping a service.
14631463
Defaults to 60. Set this to zero (0) seconds to wait indefinitely.
14641464

1465-
`--all`
1466-
1467-
: Run *`subcommand`* on all services.
1468-
1469-
`--json`
1470-
1471-
: Output as JSON.
1472-
14731465
`--no-wait`
14741466

14751467
: Don't wait for `stop` to finish stopping the service.
@@ -1478,6 +1470,14 @@ If `sudo` is passed, operate on `/Library/LaunchDaemons` or
14781470

14791471
: When stopped, don't unregister the service from launching at login (or boot).
14801472

1473+
`--all`
1474+
1475+
: Run *`subcommand`* on all services.
1476+
1477+
`--json`
1478+
1479+
: Output as JSON.
1480+
14811481
### `setup-ruby` \[*`command`* ...\]
14821482

14831483
Installs and configures Homebrew's Ruby. If `command` is passed, it will only

manpages/brew.1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -879,25 +879,25 @@ Manage background services with macOS\[u2019] \fBlaunchctl\fP(1) daemon manager
879879
.P
880880
If \fBsudo\fP is passed, operate on \fB/Library/LaunchDaemons\fP or \fB/usr/lib/systemd/system\fP (started at boot)\. Otherwise, operate on \fB~/Library/LaunchAgents\fP or \fB~/\.config/systemd/user\fP (started at login)\.
881881
.TP
882-
[\fBsudo\fP] \fBbrew services\fP [\fBlist\fP] (\fB\-\-json\fP) (\fB\-\-debug\fP)
882+
[\fBsudo\fP] \fBbrew services\fP [\fBlist\fP] [\fB\-\-json\fP] [\fB\-\-debug\fP]
883883
List information about all managed services for the current user (or root)\. Provides more output from Homebrew and \fBlaunchctl\fP(1) or \fBsystemctl\fP(1) if run with \fB\-\-debug\fP\&\.
884884
.TP
885-
[\fBsudo\fP] \fBbrew services info\fP (\fIformula\fP|\fB\-\-all\fP|\fB\-\-json\fP)
885+
[\fBsudo\fP] \fBbrew services info\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-json\fP]
886886
List all managed services for the current user (or root)\.
887887
.TP
888-
[\fBsudo\fP] \fBbrew services run\fP (\fIformula\fP|\fB\-\-all\fP|\fB\-\-file=\fP)
888+
[\fBsudo\fP] \fBbrew services run\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP]
889889
Run the service \fIformula\fP without registering to launch at login (or boot)\.
890890
.TP
891-
[\fBsudo\fP] \fBbrew services start\fP (\fIformula\fP|\fB\-\-all\fP|\fB\-\-file=\fP)
891+
[\fBsudo\fP] \fBbrew services start\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP]
892892
Start the service \fIformula\fP immediately and register it to launch at login (or boot)\.
893893
.TP
894-
[\fBsudo\fP] \fBbrew services stop\fP (\fB\-\-keep\fP) (\fB\-\-no\-wait\fP|\fB\-\-max\-wait=\fP) (\fIformula\fP|\fB\-\-all\fP)
894+
[\fBsudo\fP] \fBbrew services stop\fP [\fB\-\-keep\fP] [\fB\-\-no\-wait\fP|\fB\-\-max\-wait=\fP] (\fIformula\fP|\fB\-\-all\fP)
895895
Stop the service \fIformula\fP immediately and unregister it from launching at login (or boot), unless \fB\-\-keep\fP is specified\.
896896
.TP
897897
[\fBsudo\fP] \fBbrew services kill\fP (\fIformula\fP|\fB\-\-all\fP)
898898
Stop the service \fIformula\fP immediately but keep it registered to launch at login (or boot)\.
899899
.TP
900-
[\fBsudo\fP] \fBbrew services restart\fP (\fIformula\fP|\fB\-\-all\fP|\fB\-\-file=\fP)
900+
[\fBsudo\fP] \fBbrew services restart\fP (\fIformula\fP|\fB\-\-all\fP) [\fB\-\-file=\fP]
901901
Stop (if necessary) and start the service \fIformula\fP immediately and register it to launch at login (or boot)\.
902902
.TP
903903
[\fBsudo\fP] \fBbrew services cleanup\fP
@@ -912,17 +912,17 @@ When run as root on macOS, run the service(s) as this user\.
912912
\fB\-\-max\-wait\fP
913913
Wait at most this many seconds for \fBstop\fP to finish stopping a service\. Defaults to 60\. Set this to zero (0) seconds to wait indefinitely\.
914914
.TP
915-
\fB\-\-all\fP
916-
Run \fIsubcommand\fP on all services\.
917-
.TP
918-
\fB\-\-json\fP
919-
Output as JSON\.
920-
.TP
921915
\fB\-\-no\-wait\fP
922916
Don\[u2019]t wait for \fBstop\fP to finish stopping the service\.
923917
.TP
924918
\fB\-\-keep\fP
925919
When stopped, don\[u2019]t unregister the service from launching at login (or boot)\.
920+
.TP
921+
\fB\-\-all\fP
922+
Run \fIsubcommand\fP on all services\.
923+
.TP
924+
\fB\-\-json\fP
925+
Output as JSON\.
926926
.SS "\fBsetup\-ruby\fP \fR[\fIcommand\fP \.\.\.]"
927927
Installs and configures Homebrew\[u2019]s Ruby\. If \fBcommand\fP is passed, it will only run Bundler if necessary for that command\.
928928
.SS "\fBshellenv\fP \fR[\fIshell\fP \.\.\.]"

0 commit comments

Comments
 (0)