refine getopts and warning