I'm using yargs with .commandDir(). When an unknown/invalid subcommand is called, yargs seemingly does nothing. Is there a way to catch this? I think the best thing to do here would be display usage, but I don't see any hooks to be able to do that.
@fearphage if on the top-level yargs object you set: .strict() it will start reporting an error when an unknown command is used.
Would it be helpful if we updated the documentation for strict() to mention that it requires known commands? would happily accept a patch for this.
Thanks for the prompt response. I agree the documentation around this could be punched up a bit.
Most helpful comment
@fearphage if on the top-level yargs object you set:
.strict()it will start reporting an error when an unknown command is used.Would it be helpful if we updated the documentation for
strict()to mention that it requires known commands? would happily accept a patch for this.