davetron5000 / gli

Make awesome command-line applications the easy way
http://davetron5000.github.io/gli
Apache License 2.0
1.26k stars 102 forks source link

Bad `help` command returns zero status code #255

Closed JacobEvelyn closed 3 years ago

JacobEvelyn commented 7 years ago

Using the help command with a bad argument, e.g. friends help garbage gives me this GLI error:

error: Unknown command 'garbage'.  Use 'friends help' for a list of commands.

But despite this being an error state, the status code returned is 0. Is there a way to make this nonzero?

davetron5000 commented 7 years ago

There's always a way :)

I'm surprised though, because an unknown command error should exit 1.

There's code to put an unknown command back into the args in case the user is trying to use a default command—maybe that's where it's going wrong?

davetron5000 commented 3 years ago

Closing as old. Please reopen with a repo example if you are still experiencing this