diff --git a/git-clone-related b/git-clone-related index 1cef876..8186c1b 100755 --- a/git-clone-related +++ b/git-clone-related @@ -56,8 +56,10 @@ if [ "$1" = "--upstream-branch" ]; then shift fi +SCRIPT_NAME=$(basename -- "$0") + if [ "$#" -lt 2 ]; then - echo "Usage: $0 UPSTREAM_ORG REPO_NAME [DESTINATION] [GIT_CLONE_ARGS...]" >&2 + echo "Usage: ${SCRIPT_NAME} UPSTREAM_ORG REPO_NAME [DESTINATION] [GIT_CLONE_ARGS...]" >&2 exit 1 fi @@ -167,4 +169,4 @@ else }; }; } fi -echo "$0: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)" +echo "${SCRIPT_NAME}: ${DESTINATION} is at $(cd "${DESTINATION}" && git rev-parse HEAD)" diff --git a/git-find-fork b/git-find-fork index e7f0cc5..09d5e3a 100755 --- a/git-find-fork +++ b/git-find-fork @@ -10,9 +10,9 @@ # Often, you can use the `git-clone-related` script instead of this one. if [ "$#" -ne 3 ]; then - script=$(basename -- "$0") - >&2 echo "Error: $script requires 3 arguments, got $#" - >&2 echo "Usage: $script ORG UPSTREAM_ORG REPONAME" + SCRIPT_NAME=$(basename -- "$0") + >&2 echo "Error: ${SCRIPT_NAME} requires 3 arguments, got $#" + >&2 echo "Usage: ${SCRIPT_NAME} ORG UPSTREAM_ORG REPONAME" exit 1 fi