Author: NicolasPierron
Date: Wed Sep  7 10:02:14 2011
New Revision: 29076
URL: https://svn.nixos.org/websvn/nix/?rev=29076&sc=1

Log:
nix-prefetch-git: Display usage message if missing builder arguments are
missing.

Modified:
   nixpkgs/trunk/pkgs/build-support/fetchgit/nix-prefetch-git

Modified: nixpkgs/trunk/pkgs/build-support/fetchgit/nix-prefetch-git
==============================================================================
--- nixpkgs/trunk/pkgs/build-support/fetchgit/nix-prefetch-git  Wed Sep  7 
10:02:12 2011        (r29075)
+++ nixpkgs/trunk/pkgs/build-support/fetchgit/nix-prefetch-git  Wed Sep  7 
10:02:14 2011        (r29076)
@@ -55,9 +55,24 @@
   fi
 done
 
-if test -z "$url"; then
-    echo "syntax: nix-prefetch-git URL [REVISION [EXPECTED-HASH]]" >&2
+usage(){
+    echo  >&2 "syntax: nix-prefetch-git [options] [URL [REVISION 
[EXPECTED-HASH]]]
+
+Options:
+      --out path      Path where the output would be stored.
+      --url url       Any url understand by 'git clone'.
+      --rev ref       Any sha1 or references (such as refs/heads/master)
+      --hash h        Expected hash.
+      --deepClone     Clone submodules recursively.
+      --no-deepClone  Do not clone submodules.
+      --leave-dotGit  Keep the .git directories.
+      --builder       Clone as fetchgit does, but url, rev, and out option are 
mandatory.
+"
     exit 1
+}
+
+if test -z "$url"; then
+  usage
 fi
 
 
@@ -200,8 +215,9 @@
 }
 
 if test -n "$builder"; then
-    mkdir $out
-    clone_user_rev "$out" "$url" "$rev"
+  test -n "$out" -a -n "$url" -a -n "$rev" || usage
+  mkdir $out
+  clone_user_rev "$out" "$url" "$rev"
 else
   if test -z "$hashType"; then
       hashType=sha256
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to