bin/hey: fallback to hey-X binary

Allows for extensions.
This commit is contained in:
Henrik Lissner 2021-01-24 13:06:03 -05:00
parent 4a57fc7d2a
commit 24a93a756b

View file

@ -217,8 +217,12 @@ function main {
h|help) _usage ;; h|help) _usage ;;
-*) _do nix-env "$cmd" "$@" ;; -*) _do nix-env "$cmd" "$@" ;;
"") _usage ;; "") _usage ;;
*) echo "Couldn't find command: $cmd" 1>&2 *) if command -v hey-$cmd >/dev/null; then
exit 1 hey-$cmd $@
else
echo "Couldn't find command: $cmd" 1>&2
exit 1
fi
;; ;;
esac esac
} }