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

BUG: When I add validation to a prompt schema, the name is outputted instead of the description when prompting. #69

Closed
trusktr opened this issue May 14, 2013 · 3 comments

Comments

@trusktr
Copy link

trusktr commented May 14, 2013

e.g. If I do this:

var promptProperties = [                                                                                                                                   
     {
         description: "Enter your username",
         name: 'username',
         validator: /^[a-zAZ0-9\._-]+$/,
         warning: 'Username must be only letters and/or numbers'
     },
     {
         description: "Enter your password",
         name: 'password',
         hidden: true
     },  
     {
         description: "Enter the message subject",
         name: 'subject'
     },  
     {
         description: "Enter the email message",
         name: 'message'
     }
];

then the first prompt shows prompt: username: but if I do

var promptProperties = [                                                                                                                                   
     {
         description: "Enter your username",
         name: 'username',
     },
     {
         description: "Enter your password",
         name: 'password',
         hidden: true
     },  
     {
         description: "Enter the message subject",
         name: 'subject'
     },  
     {
         description: "Enter the email message",
         name: 'message'
     }   
];

then the first prompt shows prompt: Enter your username: as expected.

@vasekch
Copy link

vasekch commented Jul 9, 2015

exactly same problem here, adding either warning or validator option prevents description from displaying

@LucasHillSweet
Copy link

+1

@martinpucala
Copy link

There is some weird stuff going on in the promtp's convert() functions, probably something to do with older properties format and trying to convert that automatically to the new format, losing information in the process.

Try renaming "validator" to "pattern", "warning" to "message" and "empty" to "required" (plus change the value), that worked for me.

gangstead added a commit that referenced this issue Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants