Skip to content

Commit

Permalink
feat: add default answer param to confirm (#215)
Browse files Browse the repository at this point in the history
@W-12521197@
  • Loading branch information
peternhale committed Feb 9, 2023
1 parent 06b4a95 commit dc40d45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ export abstract class SfCommand<T> extends Command {
*
* @param message text to display. Do not include a question mark.
* @param ms milliseconds to wait for user input. Defaults to 10s.
* @param defaultAnswer boolean to set the default answer to. Defaults to true.
* @return true if the user confirms, false if they do not.
*/
public async confirm(message: string, ms = 10000): Promise<boolean> {
return this.prompter.confirm(message, ms);
public async confirm(message: string, ms = 10000, defaultAnswer = true): Promise<boolean> {
return this.prompter.confirm(message, ms, defaultAnswer);
}

/**
Expand Down

0 comments on commit dc40d45

Please sign in to comment.