Added support for a --tag argument to directly set the tag name in the header.

This commit is contained in:
Phally 2012-05-05 12:35:42 +02:00
parent 1235e4a5ad
commit 4f55198dca

View file

@ -2,12 +2,17 @@
FILE=""
LIST=false
TAG="n.n.n"
while [ "$1" != "" ]; do
case $1 in
-l | --list )
LIST=true
;;
-t | --tag )
TAG=$2
shift
;;
* )
FILE=$1
;;
@ -16,7 +21,7 @@ while [ "$1" != "" ]; do
done
DATE=`date +'%Y-%m-%d'`
HEAD="\nn.n.n / $DATE \n==================\n\n"
HEAD="\n$TAG / $DATE \n==================\n\n"
if $LIST; then
version=$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))