From 9c9a41ce0d3773040d4b9a62c4c99c62196c418d Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 23 Sep 2012 18:56:07 +0100 Subject: infrastructure for reviews --- new-doc | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'new-doc') diff --git a/new-doc b/new-doc index 9c0f0c4..d99c79d 100755 --- a/new-doc +++ b/new-doc @@ -2,9 +2,7 @@ here="$(cd "$(dirname "$0")";pwd)"; cd "$(dirname "$0")"/src -if [[ $# -eq 0 ]]; then - cat <&2 echo "$usage" + exit 1 fi shopt -s extglob @@ -23,10 +24,16 @@ shopt -s extglob now="$(TZ=UTC date +'%F %T')" force=0 -if [[ "$1" == "-f" ]]; then - force=1 - shift -fi +kind='' +while getopts fk: optname; do + case "$optname" in + f) force=1 ;; + k) kind="$OPTARG" ;; + ?) echo "$usage"; exit 2 ;; + esac +done +shift $[ $OPTIND - 1 ] + docname="$1" shift declare -a tags @@ -71,7 +78,7 @@ EOF echo "/document.${lang}.du.xml" >> "${docname}/.gitignore" done -ln -s "${docname//+([^\/])/..}"/../templates/du2html.xsl "$docname"/ +ln -s "${docname//+([^\/])/..}"/../templates/du2html${kind:+"-$kind"}.xsl "$docname"/du2html.xsl cd "$here" ./new-tag "${tags[@]}" -- cgit v1.2.3