add argument parsing with getopt.