Hi all,
just found (probably) a solution for the problem of parameter/flag
positioning in GRASS scripts (especially tcltkgrass is affected, reported by
Andreas for g.manual):
getopts
http://orca.st.usm.edu/~seyfarth/unix/unix-6-11-17.html
* getopts gets shell scripts options
* while getopts ivo: op
do
case $op in
i) invert=1 ;;
v) verbose=1 ;;
o) filename=$OPTARG ;;
esac
done
shift 'expr $OPTIND - 1'
* After the shift the remaining arguments are in $*
* Script option syntax is flexible:
doit -i -v file1
doit -iv file1 -o file2
This might be a way to allow flexible flag/parameters:
man getopts:
"getopts is used by shell procedures to parse positional parameters."
Maybe someone is willing to update g.manual script and we update other
scripts later while learning from the g.manual implementation.
Regards
Markus
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'