adapt getopts