Hi,
I have a program where I want to use getopts.
I want to use "-i" option and then optionally supply arguments.
If user dosent supply arguments, then also it should work.
Please tell me how to proceed.
Here is some code, this is not right code btw but a sample to understand what I want to do:
while getopts :tui:c:p: swtch
do
case $swtch in
u) echo "Un-installing feature is under development.";;
i)
echo $OPTARG
if [[ $OPTARG = "" ]]
then
ValidateInput
else
ValidateInput ${OPTARG}
\?) usage ;;
esac
done
shift $(($OPTIND -1))