@@ -22,6 +22,22 @@ else
2222 leaveDotGit=true
2323fi
2424
25+usage(){
26+ echo >&2 "syntax: nix-prefetch-git [options] [URL [REVISION [EXPECTED-HASH]]]
27+
28+Options:
29+ --out path Path where the output would be stored.
30+ --url url Any url understand by 'git clone'.
31+ --rev ref Any sha1 or references (such as refs/heads/master)
32+ --hash h Expected hash.
33+ --deepClone Clone submodules recursively.
34+ --no-deepClone Do not clone submodules.
35+ --leave-dotGit Keep the .git directories.
36+ --fetch-submodules Fetch submodules.
37+ --builder Clone as fetchgit does, but url, rev, and out option are mandatory.
38+"
39+ exit 1
40+}
2541
2642argi=0
2743argfun=""
@@ -38,6 +54,7 @@ for arg; do
3854 --leave-dotGit) leaveDotGit=true;;
3955 --fetch-submodules) fetchSubmodules=true;;
4056 --builder) builder=true;;
57+ --help) usage; exit;;
4158 *)
4259 argi=$(($argi + 1))
4360 case $argi in
@@ -59,23 +76,6 @@ for arg; do
5976 fi
6077done
6178
62−usage(){
63− echo >&2 "syntax: nix-prefetch-git [options] [URL [REVISION [EXPECTED-HASH]]]
64−
65−Options:
66− --out path Path where the output would be stored.
67− --url url Any url understand by 'git clone'.
68− --rev ref Any sha1 or references (such as refs/heads/master)
69− --hash h Expected hash.
70− --deepClone Clone submodules recursively.
71− --no-deepClone Do not clone submodules.
72− --leave-dotGit Keep the .git directories.
73− --fetch-submodules Fetch submodules.
74− --builder Clone as fetchgit does, but url, rev, and out option are mandatory.
75−"
76− exit 1
77−}
78−
7979if test -z "$url"; then
8080 usage
8181fi