dd_getopts.c most of main moved to a function