included getopts_example rewrote set_scanmode