read getopt manual, now I know what I was doing wrong!