[PATCH 12/25] git-lost-found: Print usage message on incorrect invocation.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
---
git-lost-found.sh | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
2b2c389a8816f40cfa5b562203988b0c0b2269c5
diff --git a/git-lost-found.sh b/git-lost-found.sh
index 2beec2a..757e51f 100755
--- a/git-lost-found.sh
+++ b/git-lost-found.sh
@@ -1,6 +1,16 @@
#!/bin/sh
-GIT_DIR=`git-rev-parse --git-dir` || exit $?
+. git-sh-setup
+
+usage () {
+ die "usage: $0"
+}
+
+if [ "$#" != "0" ]
+then
+ usage
+fi
+
laf="$GIT_DIR/lost-found"
rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit
--
0.99.9.GIT