Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66a0a0a

Browse files
committed
Make the option processing more robust.
Add a -F option similar to "cvs commit -F <file>". Add a -t option to allow specifying the prefix to the directory into which the docs should be unpacked (useful when I start trying out new styles for the presentation).
1 parent 8c2133d commit 66a0a0a

1 file changed

Lines changed: 31 additions & 7 deletions

File tree

Doc/tools/push-docs.sh

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,36 @@ fi
1919

2020
EXPLANATION=''
2121

22-
if [ "$1" = '-m' ] ; then
23-
EXPLANATION="$2"
24-
shift 2
25-
elif [ "$1" ] ; then
26-
EXPLANATION="`cat $1`"
27-
shift 1
22+
while [ "$#" -gt 0 ] ; do
23+
case "$1" in
24+
-m)
25+
EXPLANATION="$2"
26+
shift 2
27+
;;
28+
-t)
29+
DOCTYPE="$2"
30+
shift 2
31+
;;
32+
-F)
33+
EXPLANATION="`cat $2`"
34+
shift 2
35+
;;
36+
-*)
37+
echo "Unknown option: $1" >&2
38+
exit 2
39+
;;
40+
*)
41+
break
42+
;;
43+
esac
44+
done
45+
if [ "$1" ] ; then
46+
if [ "$EXPLANATION" ] ; then
47+
echo "Explanation may only be given once!" >&2
48+
exit 2
49+
fi
50+
EXPLANATION="$1"
51+
shift
2852
fi
2953

3054
START="`pwd`"
@@ -45,7 +69,7 @@ ssh python.sourceforge.net tmp/update-docs.sh $DOCTYPE $PACKAGE '&&' rm tmp/upda
4569
Mail -s "[$DOCLABEL doc updates]" $ADDRESSES <<EOF
4670
The development version of the documentation has been updated:
4771
48-
http://python.sourceforge.net/$DOCTYPE-docs/
72+
http://python.sourceforge.net/$DOCTYPE-docs/
4973
5074
$EXPLANATION
5175
EOF

0 commit comments

Comments
 (0)