Have this code

shift; while getopts :ugr: arg; do case ${arg} in
   u) action="freebsd-update";;
   g) action="freebsd-upgrade";;
   r) action="freebsd-rollback";;
   ?) exerr ${cmd_usage};;
esac; done; shift $(( ${OPTION} -1 ))


Command being executed looks like this, cmd action -flags aaaa bbbb

Only a single -flag in allowed on the command.

$# gives a count of parms ie: aaaa bbbb. in this example a count of 2.

I am looking for something to check that holds the number of flags on the command. so I can code. if flag_count gt 1 = error

Is there such a thing created by getopts?
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to