I would like to add couple of optional arguments in getopts. For example, for the below code, i want to add 2 optional arguments - cagefile
and knownlinc
. How can i do that by modifying this code?
while getopts ":b:c:g:hr:" opt; do
case $opt in
b)
blastfile=$OPTARG
;;
c)
comparefile=$OPTARG
;;
h)
usage
exit 1
;;
g)
referencegenome=$OPTARG
;;
r)
referenceCDS=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done