added mac support to command-not-found module
This commit is contained in:
parent
c98da90662
commit
56e6dad913
2 changed files with 17 additions and 2 deletions
|
@ -4,12 +4,23 @@ Command-Not-Found
|
|||
Displays installation information for not found commands by loading the
|
||||
[command-not-found][1] tool on Debian-based and Arch Linux-based distributions.
|
||||
|
||||
For users of Mac OS X, if homebrew and [homebrew-command-not-found][2] are properly installed, this module will provide similar information as is presented to Linux users.
|
||||
|
||||
For example... (on OSX with Homebrew)
|
||||
|
||||
```bash
|
||||
$ when
|
||||
The program 'when' is currently not installed. You can install it by typing:
|
||||
brew install when
|
||||
```
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
*The authors of this module should be contacted via the [issue tracker][2].*
|
||||
*The authors of this module should be contacted via the [issue tracker][3].*
|
||||
|
||||
- [Joseph Booker](https://github.com/sargas)
|
||||
|
||||
[1]: https://code.launchpad.net/command-not-found
|
||||
[2]: https://github.com/sorin-ionescu/prezto/issues
|
||||
[2]: https://github.com/bfontaine/homebrew-command-not-found
|
||||
[3]: https://github.com/sorin-ionescu/prezto/issues
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
# Authors:
|
||||
# Joseph Jon Booker <joe@neoturbine.net>
|
||||
# Alex Gray <alex@mrgray.com> (Mac Support)
|
||||
#
|
||||
|
||||
# Load command-not-found on Debian-based distributions.
|
||||
|
@ -11,6 +12,9 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
|
|||
# Load command-not-found on Arch Linux-based distributions.
|
||||
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
||||
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
||||
# Load command-not-found on Mac OS X with https://github.com/bfontaine/homebrew-command-not-found installed
|
||||
elif [[ $(type -f brew) ]] && [[ -s ${HANDLER=$(brew --prefix)/Library/Taps/bfontaine/homebrew-command-not-found/handler.sh} ]]; then
|
||||
source "${HANDLER}"
|
||||
# Return if requirements are not found.
|
||||
else
|
||||
return 1
|
||||
|
|
Loading…
Add table
Reference in a new issue