Brew-file has been updated.
The new wrapper function allows you to use some subcommands of brew-file
directly as a brew
’s subcommand.
Completion functions are also implemented for both Bash and Zsh.
Completion
There are new files of etc/bash_completion.d/brew-file and share/zsh/site-functions/_brew-file.
_brew-file is just a symbolic link to brew-file.
They have the functions of the completion for brew-file
command.
To enable the completion, please add the following settings for each Bash or Zsh.
- For Bash
First, please install
Bash-Completion: http://bash-completion.alioth.debian.org/
by:
$ brew install bash-completion
Then, add following settings to your .bashrc:
1 2 3 4 |
|
- For Zsh
Add following settings in your .zshrc:
1 2 3 4 5 6 |
|
In case you have installed zsh-completions
(can be installed by brew: $ brew install zsh-completions
)、
settings can be like:
1 2 3 4 5 6 7 8 |
|
to enable both zsh-completions and site-functions.
brew-wrap
The above completion is done only for brew-file
command.
It doesn’t complete such brew file
(brew
+ file
subcommand).
etc/brew-wrap
has a wrapper setting to override original brew
completion.
It adds file
subcommand to brew
, and enable a completion
for brew file
as same as brew-file
.
1 2 3 4 |
|
This file should be read after above completion settings, like
1 2 3 4 5 6 7 8 9 10 |
|
brew-wrap
wraps brew
command itself
to automatically update Brewfile after such brew install
or brew uninstall
.
Moreover, some subcommands of brew-file
can be used directly as a brew
’s subcommand,
if the command is not in originally brew
’s subcommands.
Such init
or casklist
are not in brew
’s subcommands.
Therefore
$ brew init
becomes as same as
$ brew file init
and
$ brew casklist
can be used as
$ brew file casklist