flatiron / prompt

a beautiful command-line prompt for node.js

Home Page:http://github.com/flatiron/prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting 'warning' or 'validator' removes the 'description'

ebbmo opened this issue · comments

commented

Hi,

Up front: AWESOME package! Cheers mate :)

On to my issue. When I set a prompt with the following properties:

name: 'script',
description: 'Pick script',
type: 'integer',
required: true,

I get the prompt as expected:
prompt: Pick script:

But when I add the warning or validation property, the description is replaced with the name again:

name: 'script',
description: 'Pick script',
type: 'integer',
required: true,
warning: 'Only numbers from 1 to 3...',

turns into:
prompt: script:

The same applies, if I use validation in the properties with or instead of the validation.

Is this intended? I couldn't find a documentation on this, besides using the 'array' type - but in my case i'm prompting for an integer.

Any idea?

KR, ebb

Same issue here