Created
January 27, 2015 19:41
-
-
Save beatgammit/05b8f000919e06860a5d to your computer and use it in GitHub Desktop.
nicer command not found handler for Arch using pkgfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_command_not_found --on-event fish_command_not_found | |
echo "fish: Unknown command '$argv'" >&2 | |
if functions -q __fish_command_not_found_setup | |
functions -e __fish_command_not_found_setup | |
end | |
if which pkgfile ^/dev/null >/dev/null | |
if test (count $argv) -ge 1 | |
if pkgfile --binaries $argv[1] ^/dev/null >/dev/null | |
echo -e "\n'$argv[1]' can be found in these packages:" | |
for pkg in (pkgfile --binaries "$argv[1]") | |
echo -e "\t$pkg" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment