[FEATURE] Add a handler for *unknown* options, analogous to invalidHandler
#41
Labels
Enhancement
new feature or improvement
invalidHandler
#41
Currently (v3.0.1), nopt invariably accepts unknown options and simply adds them to the object returned.
However, a typical use case for a CLI is to abort processing in case an unknown option is specified.
Thus, an
.unknownHandler
property specifying a function to call on encountering an unknown option would be handy - analogous to the existing.invalidHandler
property for handling invalid option values.I'd be happy to implement this.
The text was updated successfully, but these errors were encountered: