+seen_c=false
+seen_o=false
+
+for arg
+do
+ case $arg in
+ -c)
+ seen_c=true;;
+ # It is acceptable not to leave a space between the '-o' option
+ # and its argument, so we have to cater for that.
+ -o|-o*)
+ seen_o=true;;
+ esac
+ if $seen_c && $seen_o; then