archimport: safer log file parsing
[git.git] / git-add.sh
index a8498c7..fdec86d 100755 (executable)
@@ -1,5 +1,14 @@
 #!/bin/sh
 
+die () {
+    echo >&2 "$*"
+    exit 1
+}
+
+usage() {
+    die "usage: git add [-n] [-v] <file>..."
+}
+
 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)