process command line options with getopt_long()

This commit refactors the option processing from a simple string check to a call
to getopt_long.  This is in preparation to adding options other than just the
--pcm option, which can now also be called as -p.