remove getoptflags helper, use queryconfig instead