X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-add.sh;h=fdec86d1a41af847f9d737a2c058e2d2027f32fe;hb=ed24928e122bad83e62d161087f806fa21c46a59;hp=a8498c729ab3188bd21dd6a54ddc77d4c34ac48a;hpb=caf4f582b2bb4d5582540aa49d29749b2600cd03;p=git.git diff --git a/git-add.sh b/git-add.sh index a8498c72..fdec86d1 100755 --- a/git-add.sh +++ b/git-add.sh @@ -1,5 +1,14 @@ #!/bin/sh +die () { + echo >&2 "$*" + exit 1 +} + +usage() { + die "usage: git add [-n] [-v] ..." +} + show_only= verbose= while : ; do @@ -10,6 +19,9 @@ while : ; do -v) verbose=--verbose ;; + -*) + usage + ;; *) break ;; @@ -23,10 +35,10 @@ if test -f "$GIT_DIR/info/exclude" then git-ls-files -z \ --exclude-from="$GIT_DIR/info/exclude" \ - --others --exclude-per-directory=.gitignore "$@" + --others --exclude-per-directory=.gitignore -- "$@" else git-ls-files -z \ - --others --exclude-per-directory=.gitignore "$@" + --others --exclude-per-directory=.gitignore -- "$@" fi | case "$show_only" in true)