getopts: simplify the switch construction