You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current prompt system is still pretty raw, while the consola package we're using has a fancier way of asking for prompts.
Describe the solution you'd like
Use the consola.prompt function, an example of this for the import-reconciliation command could look like this:
function requireCommandPromptConfirmation(options, callback) {
if (!options.yes) {
cliUtils.promptConfirmation().then((confirmed) => {
console.log(confirmed);
if (confirmed === true) {
callback(options);
}
});
} else {
callback(options);
}
}
function importReconciliation(options) {
cliUtils.checkDefaultFirm(options.firm, firmIdDefault);
if (options.handle) {
toolkit.fetchReconciliationByHandle(options.firm, options.handle);
} else if (options.id) {
toolkit.fetchReconciliationById(options.firm, options.id);
} else if (options.all) {
toolkit.fetchAllReconciliations(options.firm);
}
}
// READ reconciliations
program
.command("import-reconciliation")
.description("Import reconciliation templates")
.requiredOption(
"-f, --firm <firm-id>",
"Specify the firm to be used",
firmIdDefault
)
.option("-h, --handle <handle>", "Import a specific reconciliation by handle")
.option("-i, --id <id>", "Import a specific reconciliation by id")
.option("-a, --all", "Import all reconciliations")
.option("--yes", "Skip the prompt confirmation (optional)")
.action((options) => {
cliUtils.checkUniqueOption(["handle", "id", "all"], options);
requireCommandPromptConfirmation(options, importReconciliation);
});
Describe alternatives you've considered
Keep using the standard prompts
Additional context
FR noted down and discussed with @AgustinSilverfin during review of #59; decided to move this to a separate issue since we decided to leave it out of the scope of the initial PR.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The current prompt system is still pretty raw, while the consola package we're using has a fancier way of asking for prompts.
Describe the solution you'd like
Use the consola.prompt function, an example of this for the import-reconciliation command could look like this:
Describe alternatives you've considered
Keep using the standard prompts
Additional context
FR noted down and discussed with @AgustinSilverfin during review of #59; decided to move this to a separate issue since we decided to leave it out of the scope of the initial PR.
The text was updated successfully, but these errors were encountered: