implement -p option