X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=.shellrc;h=2162d3b5164c77f7f430b824437a5dd3a31774b9;hb=bb774a1a3b907df994f1e473e6a5e0dd3daf4c86;hp=112fa4422eb59ef2c2c7f4d1358bf4aa66c7b382;hpb=658792891f015902124dbf8601c541fd3959ca3e;p=dotfiles.git diff --git a/.shellrc b/.shellrc index 112fa44..2162d3b 100644 --- a/.shellrc +++ b/.shellrc @@ -225,6 +225,12 @@ if test -x /usr/bin/git >/dev/null 2>&1; then cdgitpath remote.$remote.url else + if [ -n "$1" ]; then + echo "Cannot find directory for remote $1" >&2 + echo "Usage: cdremote [remote_name]" >&2 + return 1 + fi + _list_remotes '^\(/\|\.\./\)' # (/ or ../ at the beginning) if [ ${#GIT_REMOTES[*]} -eq 1 ]; then remote=${GIT_REMOTES[0]}