I want to write a DOS script with multiple optional option flags. I have to parse these optional options.
An example:
get_resolution.bat /?
get_resolution.bat /h input.jpg
get_resoltion.bat /v input.jpg
Under *NIX this can be done with getopts.
The same examples under *nix:
get_resolution -?
get_resolution -h input.jpg
get_resolution -v input.jpg
In the *nix script txt file get_resolution
one would then write:
while getopts ?hv flag
do
case $flag in
?) man get_resolution
h) get_horizontal_resolution $1
v) get_vertical_resolution $1 ;;
esac
done
Does there exist a DOS equivalent for the *nix getopts?