fix getopts not handling -p option.