added parsing of command-line options in __main__