nest-commander
nest-commander copied to clipboard
How to Access showHelpAfterError/showSuggestionAfterError/Other Options
Is there an existing issue that is already proposing this?
- [X] I have searched the existing issues
Is your feature request related to a problem? Please describe it
Hey, how can I access other options that are not available as decorators. On https://www.npmjs.com/package/commander there are a lot of features that are not detailed in the nestjs-commander documentation. In particular, how can I access showHelpAfterError() and showSuggestionAfterError()?
Describe the solution you'd like
More docs or expose the regular commander.js methods somehow.
Teachability, documentation, adoption, migration strategy
N/a
What is the motivation / use case for changing the behavior?
N/A
This is something I need to add support for I believe. I'm thinking they'll be options as a part of the @Command()
decorator, something like
@Command({ name: 'foo', options: { showSuggestionAfterError: boolean | string, showHelpAfterError: boolean | string })
So that the setup can just call the method or pass the message directly. I don't see a reason to get DI involved here, right?
ping @ProfessorManhattan :eyes:
ping @ProfessorManhattan :eyes:
You rang?
:smile: do you agree with that interface to solve this issue?
@Command({
name: 'foo',
options: {
showSuggestionAfterError: true,
showHelpAfterError: '',
}
})
it's fine to me
:smile: do you agree with that interface to solve this issue?
@Command({ name: 'foo', options: { showSuggestionAfterError: true, showHelpAfterError: '', } })
it's fine to me
Yeah, it's been awhile but that would be good. I remember wanting to be able to access the native commander library object as well.
You can access the command instance in v3.0.0 with this.command
after extending the CommandRunner