add check for getopt.h and improve illegal option help tips.
format code