Skip to content

Instantly share code, notes, and snippets.

@beatgammit
Created January 27, 2015 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beatgammit/05b8f000919e06860a5d to your computer and use it in GitHub Desktop.
Save beatgammit/05b8f000919e06860a5d to your computer and use it in GitHub Desktop.
nicer command not found handler for Arch using pkgfile
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