Skip to content

Instantly share code, notes, and snippets.

@trast
Created June 3, 2013 14:44
Show Gist options
  • Select an option

  • Save trast/5698680 to your computer and use it in GitHub Desktop.

Select an option

Save trast/5698680 to your computer and use it in GitHub Desktop.
git-filter-branch.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git i/git-filter-branch.sh w/git-filter-branch.sh
index ac2a005..086807c 100755
--- i/git-filter-branch.sh
+++ w/git-filter-branch.sh
@@ -137,7 +137,12 @@ do
# all switches take one argument
ARG="$1"
- case "$#" in 1) usage ;; esac
+ case "$#" in
+ 1)
+ echo >&2 "option $ARG without argument"
+ usage
+ ;;
+ esac
shift
OPTARG="$1"
shift
@@ -175,6 +180,7 @@ do
orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
;;
*)
+ echo >&2 "error: unknown option $ARG"
usage
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment