implementation of -h option