use the correct d option in getopt instead of the removed f