-
Notifications
You must be signed in to change notification settings - Fork 1k
Allow command builder to accept a promise #1042
Copy link
Copy link
Closed
Labels
Description
Feature request
Allow the command builder to accept a promise like follows:
yargs.command('command', 'Does foo', async function() { ... })This feature is the same as the one from #510 but for the command builder.
Note: in #510, the example shows the async function as 3rd parameter, it should be as 4th because the 3rd is actually the command builder and not the command handler. I'll update this note when the comment is fixed.
Use case
The defaults of a command's parameter depend on the configuration of the app.
In some cases the configuration is not defined => the app prompts the user and helps him bootstrap the configuration then runs the initial command.
The command builder needs to be async.
Reactions are currently unavailable