Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle return from yargs command modules #262

Merged
merged 1 commit into from
Jul 9, 2018
Merged

Conversation

RomainMuller
Copy link
Contributor

Prevent the application from reaching the code path in main when the
command was handled directly by a commandDir module. This prevents
the operation from succeeding, while displaying a message such as
"Unknown command: docs" (#256).

In order to achieve this, the module decorator sets argv.result on
successful execution of the command module's handler; and if
argv.result is set, main does not get called.

Fixes #256

Prevent the application from reaching the code path in `main` when the
command was handled directly by a `commandDir` module. This prevents
the operation from succeeding, while displaying a message such as
*"Unknown command: docs"* (#256).

In order to achieve this, the module decorator sets `argv.result` on
successful execution of the command module's handler; and if
`argv.result` is set, `main` does not get called.

Fixes #256
@RomainMuller RomainMuller merged commit a273f71 into master Jul 9, 2018
@RomainMuller RomainMuller deleted the rmuller/fix-256 branch July 9, 2018 13:22
@NGL321 NGL321 added the contribution/core This is a PR that came from AWS. label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"cdk docs" works but prints an error "Unknown command: docs"
3 participants