jawher / mow.cli

A versatile library for building CLI applications in Go
MIT License
871 stars 55 forks source link

Catch duplicated command line flags #80

Closed silasdavis closed 5 years ago

silasdavis commented 6 years ago

It would appear to be possible to register the same short/long options multiple times for a command. It would be better if this was caught and threw an error as early as possible. I thought it would be caught in Cmd but it was not, so then I thought maybe it was caught in cmd.Spec but it appears not to be caught there either.

In a large CLI particularly if modular its hard to see which arguments have been used.

jawher commented 5 years ago

Fixed by #86