This is simply wrong, at least according to the documentation here.  We cannot simply return error here.

```The getopt function returns the option character for the next command line option. When no more option arguments are available, it returns -1. There may still be more non-option arguments; you must compare the external variable optind against the argc parameter to check this.
```