fix Issue 9829

- getting program and arguments before calling getopt
  on the shortended args avoids the need for the '--'
  getopt separator in the first place

[Bugzilla 9829](http://d.puremagic.com/issues/show_bug.cgi?id=9829)