improve usage()
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 1 Nov 2011 09:21:54 +0000 (09:21 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 1 Nov 2011 09:21:54 +0000 (09:21 +0000)
id-release

index 244633a..429c233 100755 (executable)
@@ -10,7 +10,8 @@
 set -e
 
 usage () {
-    echo "usage $0 version"
+    echo  >&2 "usage $0 version"
+    echo  >&2 "$@"
     exit 1
 }
 
@@ -33,8 +34,7 @@ else
 fi
 
 if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then
-    echo "No *.spec file found"
-    usage
+    usage "No *.spec file found"
 else
     spec=`ls |egrep '\.spec$' | head -1`
     package=`perl -ne 's/\s*$//; print if s/^NAME=//' IDMETA`