git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #10998 from andrewrynhard/master

Add help flag to nix-prefetch-git

commit9c571a98ed1eac45c0d7e5df2e12145d39a07b87 authorDomen Kožar <domen@dev.si> dateTue 19 Jan 2016, 12:01 (11 years ago) parent44d0d5842ff8ad
1 file changed+17−17
pkgs/build-support/fetchgit/nix-prefetch-git+17−17
pkgs/build-support/fetchgit/nix-prefetch-git+17−17
@@ -24,6 +24,22 @@ else
2424 leaveDotGit=true
2525fi
2626
27+usage(){
28+ echo >&2 "syntax: nix-prefetch-git [options] [URL [REVISION [EXPECTED-HASH]]]
29+
30+Options:
31+ --out path Path where the output would be stored.
32+ --url url Any url understand by 'git clone'.
33+ --rev ref Any sha1 or references (such as refs/heads/master)
34+ --hash h Expected hash.
35+ --deepClone Clone submodules recursively.
36+ --no-deepClone Do not clone submodules.
37+ --leave-dotGit Keep the .git directories.
38+ --fetch-submodules Fetch submodules.
39+ --builder Clone as fetchgit does, but url, rev, and out option are mandatory.
40+"
41+ exit 1
42+}
2743
2844argi=0
2945argfun=""
@@ -40,6 +56,7 @@ for arg; do
4056 --leave-dotGit) leaveDotGit=true;;
4157 --fetch-submodules) fetchSubmodules=true;;
4258 --builder) builder=true;;
59+ --help) usage; exit;;
4360 *)
4461 argi=$(($argi + 1))
4562 case $argi in
@@ -61,23 +78,6 @@ for arg; do
6178 fi
6279done
6380
64−usage(){
65− echo >&2 "syntax: nix-prefetch-git [options] [URL [REVISION [EXPECTED-HASH]]]
66−
67−Options:
68− --out path Path where the output would be stored.
69− --url url Any url understand by 'git clone'.
70− --rev ref Any sha1 or references (such as refs/heads/master)
71− --hash h Expected hash.
72− --deepClone Clone submodules recursively.
73− --no-deepClone Do not clone submodules.
74− --leave-dotGit Keep the .git directories.
75− --fetch-submodules Fetch submodules.
76− --builder Clone as fetchgit does, but url, rev, and out option are mandatory.
77−"
78− exit 1
79−}
80−
8181if test -z "$url"; then
8282 usage
8383fi