From bb774a1a3b907df994f1e473e6a5e0dd3daf4c86 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 5 Aug 2019 19:18:42 +0300 Subject: [PATCH] .shellrc: Report error if no directory found for the argument --- .shellrc | 6 ++++++ 1 file changed, 6 insertions(+) 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]} -- 2.39.2