parseopt: move definition of enum parse_opt_result up