conform to style; simplify getopt loop; add usage function