Open correct filename.

The file opened was always argv[1] which did not take into account
any options. This was a leftover from when there was no option
processing. Must use optind correctly here.