Improve flag error messages in CLI

Now consistent in error messages and tries to show as many error messages
as possible before exiting.
Merge pull request #981 from ericmj/cli_switches

Improve flag error messages in CLI