dasher-project / dasher

Dasher
http://www.inference.phy.cam.ac.uk/dasher/
GNU General Public License v2.0
159 stars 45 forks source link

Dasher should fail for unrecognized command-line args #40

Closed dbarnett closed 7 years ago

dbarnett commented 9 years ago

Unrecognized command-line args usually cause programs to fail with an exit code, e.g.

$ ls --walrus-face
ls: unrecognized option '--walrus-face'
Try 'ls --help' for more information.

But dasher will happily start the GUI no matter what options I pass it:

$ dasher --walrus-face
** Message: Opening GUI file: /usr/local/share/dasher/dasher.traditional.ui

Could we make it validate that it doesn't receive any unrecognized args?

cagdasgerede commented 7 years ago

Mursel will work on this.

miroslavca commented 7 years ago

Hi @cagdasgerede, @dbarnett
It looks like the feature mentioned in the issue description has been added already (to Linux version at least).

I got the following output:

$ dasher --walrus-face option parsing failed: Unknown option --walrus-face

Dasher fails to start GUI as expected.

cagdasgerede commented 7 years ago

In that case, can we make it so that it says

"Try 'dasher --help' for more information."

after it says

"option parsing failed: Unknown option --walrus-face"?