Find git executable at run time
[git-darcs-import.git] / tests / uniqueoptions.sh
blobbd4d087511bb97998ba26f18743827c8675094c0
1 #!/usr/bin/env bash
2 echo
3 echo Checking that each command expects each option only once
4 echo
6 set -ev
8 if echo $OS | grep -i windows; then
9 echo Noone knows how to handle newlines under cygwin, so we skip this test
10 exit 0
13 rm -rf temp1
14 mkdir temp1
15 cd temp1
17 for i in `darcs --commands | grep -v -- -- | xargs echo`; do
18 echo -n Checking $i... ' '
19 # only output actual command options, i.e. lines that contain a --
20 darcs $i --help | grep -- "--" | sort > $i
21 uniq $i > uni$i
22 if cmp $i uni$i; then
23 echo passed.
24 else
25 echo failed!
26 diff -c uni$i $i
27 exit 1
29 done
31 cd ..
32 rm -rf temp1