Don't return 0 exit code on invalid command

Fixes #4780
Fix ls-depth-cli test on Windows.

The usual.