8b6f0b1dfbe2634c5b35f8c03f88edf2fdf20b36

Author
Celestino Gomes <tinorj@gmail.com>
Committer
Marc Cornellà <marc@mcornella.com>
Date

Message

feat(brew): add aliases for `brew services` (#10215)

Closes #10215

Co-authored-by: Marc Cornellà <marc@mcornella.com>

Diff

 1diff --git a/plugins/brew/README.md b/plugins/brew/README.md
 2index 2d099d7425cff0b160ce51bef6e12fc3a2790ab0..d70fe58426ec5e92e7d8e16982927fa63c773df3 100644
 3--- a/plugins/brew/README.md
 4+++ b/plugins/brew/README.md
 5@@ -19,30 +19,37 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen
 6 
 7 ## Aliases
 8 
 9-| Alias    | Command                                 | Description                                                         |
10-| -------- | --------------------------------------- | ------------------------------------------------------------------- |
11-| `bc`     | `brew cleanup`                          | Run cleanup.                                                        |
12-| `bci`    | `brew info --cask`                      | Display information about the given cask.                           |
13-| `bcin`   | `brew install --cask`                   | Install the given cask.                                             |
14-| `bcl`    | `brew list --cask`                      | List installed casks.                                               |
15-| `bco`    | `brew outdated --cask`                  | Report all outdated casks.                                          |
16-| `bcrin`  | `brew reinstall --cask`                 | Reinstall the given cask.                                           |
17-| `bcubc`  | `brew upgrade --cask && brew cleanup`   | Upgrade outdated casks, then run cleanup.                           |
18-| `bcubo`  | `brew update && brew outdated --cask`   | Update Homebrew data, then list outdated casks.                     |
19-| `bcup`   | `brew upgrade --cask`                   | Upgrade all outdated casks.                                         |
20-| `bfu`    | `brew upgrade --formula`                | Upgrade only formulas (not casks).                                  |
21-| `bl`     | `brew list`                             | List all installed formulae.                                        |
22-| `bo`     | `brew outdated`                         | List installed formulae that have an updated version available.     |
23-| `brewp`  | `brew pin`                              | Pin a specified formula so that it's not upgraded.                  |
24-| `brews`  | `brew list -1`                          | List installed formulae or the installed files for a given formula. |
25-| `brewsp` | `brew list --pinned`                    | List pinned formulae, or show the version of a given formula.       |
26-| `bu`     | `brew update`                           | Update brew and all installed formulae.                             |
27-| `bubc`   | `brew upgrade && brew cleanup`          | Upgrade outdated formulae and casks, then run cleanup.              |
28-| `bubo`   | `brew update && brew outdated`          | Update Homebrew data, then list outdated formulae and casks.        |
29-| `bubu`   | `bubo && bup`                           | Do the last two operations above.                                   |
30-| `bugbc`  | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup.     |
31-| `bup`    | `brew upgrade`                          | Upgrade outdated, unpinned brews.                                   |
32-| `buz`    | `brew uninstall --zap`                  | Remove all files associated with a cask.                            |
33+| Alias    | Command                                 | Description                                                           |
34+| -------- | --------------------------------------- | --------------------------------------------------------------------- |
35+| `bc`     | `brew cleanup`                          | Run cleanup.                                                          |
36+| `bci`    | `brew info --cask`                      | Display information about the given cask.                             |
37+| `bcin`   | `brew install --cask`                   | Install the given cask.                                               |
38+| `bcl`    | `brew list --cask`                      | List installed casks.                                                 |
39+| `bco`    | `brew outdated --cask`                  | Report all outdated casks.                                            |
40+| `bcrin`  | `brew reinstall --cask`                 | Reinstall the given cask.                                             |
41+| `bcubc`  | `brew upgrade --cask && brew cleanup`   | Upgrade outdated casks, then run cleanup.                             |
42+| `bcubo`  | `brew update && brew outdated --cask`   | Update Homebrew data, then list outdated casks.                       |
43+| `bcup`   | `brew upgrade --cask`                   | Upgrade all outdated casks.                                           |
44+| `bfu`    | `brew upgrade --formula`                | Upgrade only formulas (not casks).                                    |
45+| `bl`     | `brew list`                             | List all installed formulae.                                          |
46+| `bo`     | `brew outdated`                         | List installed formulae that have an updated version available.       |
47+| `brewp`  | `brew pin`                              | Pin a specified formula so that it's not upgraded.                    |
48+| `brews`  | `brew list -1`                          | List installed formulae or the installed files for a given formula.   |
49+| `brewsp` | `brew list --pinned`                    | List pinned formulae, or show the version of a given formula.         |
50+| `bsl`    | `brew services list`                    | List all running services.                                            |
51+| `bsoff`  | `brew services stop`                    | Stop the service and unregister it from launching at login (or boot). |
52+| `bsoffa` | `bsoff --all`                           | Stop all started services.                                            |
53+| `bson`   | `brew services start`                   | Start the service and register it to launch at login (or boot).       |
54+| `bsona`  | `bson --all`                            | Start all stopped services.                                           |
55+| `bsr`    | `brew services run`                     | Run the service without registering to launch at login (or boot).     |
56+| `bsra`   | `bsr --all`                             | Run all stopped services.                                             |
57+| `bu`     | `brew update`                           | Update brew and all installed formulae.                               |
58+| `bubc`   | `brew upgrade && brew cleanup`          | Upgrade outdated formulae and casks, then run cleanup.                |
59+| `bubo`   | `brew update && brew outdated`          | Update Homebrew data, then list outdated formulae and casks.          |
60+| `bubu`   | `bubo && bup`                           | Do the last two operations above.                                     |
61+| `bugbc`  | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup.       |
62+| `bup`    | `brew upgrade`                          | Upgrade outdated, unpinned brews.                                     |
63+| `buz`    | `brew uninstall --zap`                  | Remove all files associated with a cask.                              |
64 
65 ## Completion
66 
67diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
68index 717a2d82ab69bba7b4f161dc185999a256a168b8..416c56bb0bc1c34f609ba905592106191e35357b 100644
69--- a/plugins/brew/brew.plugin.zsh
70+++ b/plugins/brew/brew.plugin.zsh
71@@ -48,6 +48,13 @@ alias bl='brew list'
72 alias bo='brew outdated'
73 alias brewp='brew pin'
74 alias brewsp='brew list --pinned'
75+alias bsl='brew services list'
76+alias bsoff='brew services stop'
77+alias bsoffa='bsoff --all'
78+alias bson='brew services start'
79+alias bsona='bson --all'
80+alias bsr='brew services run'
81+alias bsra='bsr --all'
82 alias bu='brew update'
83 alias bubo='brew update && brew outdated'
84 alias bubu='bubo && bup'