Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Add option for (dis)allowing an empty string in prompter #609

Merged
merged 1 commit into from
Mar 2, 2016

Conversation

Mitko-Kerezov
Copy link
Contributor

Implemented to facilitate calls requiring nonempty strings.
Ping @rosen-vladimirov

@justcodebuilduser
Copy link

❤️

@@ -66,7 +66,7 @@ export class Prompter implements IPrompter {
return future;
}

public getPassword(prompt: string, options?: {allowEmpty?: boolean}): IFuture<string> {
public getPassword(prompt: string, options?: IAllowEmpty): IFuture<string> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have default action here? Why not using IPrompterOptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not have a default action here because I can't imagine a case where one'd want a default action to take if a password is not provided.
If, on the other hand, we use IPrompterOptions here and just don't respect the defaultAction that would be misleading to the coder.

@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/allow-nonempty-string branch 2 times, most recently from 0d33fbb to 07e8719 Compare March 2, 2016 10:09
@Mitko-Kerezov
Copy link
Contributor Author

Ping @rosen-vladimirov for a double-chek after fixing the comment

@justcodebuilduser
Copy link

❤️

1 similar comment
@justcodebuilduser
Copy link

❤️

if(defaultAction) {
schema.default = defaultAction;
if(options && options.defaultAction) {
schema.default = options.defaultAction;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can remove the if:

schema.default = options && options.defaultAction;

@rosen-vladimirov
Copy link
Collaborator

👍 after considering my comment for default action

@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/allow-nonempty-string branch from 07e8719 to 6c5a141 Compare March 2, 2016 12:06
@justcodebuilduser
Copy link

❤️

Mitko-Kerezov added a commit that referenced this pull request Mar 2, 2016
Add option for (dis)allowing an empty string in prompter
@Mitko-Kerezov Mitko-Kerezov merged commit 6d063d9 into master Mar 2, 2016
@Mitko-Kerezov Mitko-Kerezov deleted the kerezov/allow-nonempty-string branch March 2, 2016 12:12
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants