main function supports getopt_long now