3 ms·
Regarding the post topic, it's a shame bash hasn't embraced ksh93 getopts. This is enough to provide short and long options including help messages: usage=
by kps 4y ago
Regarding the post topic, it's a shame bash hasn't embraced ksh93 getopts. This is enough to provide short and long options including help messages:
usage='
[-1]
[+NAME?cmd - XXX Synopsis here]
[s:sample?XXX Sample option with argument]:[MODE]
[v:verbose?XXX Show progress]
file ...'
while getopts "$usage" _
do
typeset "opt_$_"="${OPTARG:-1}";;
done
shift OPTIND-1