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

default type doesn't work #12

Closed
alexakarpov opened this issue Sep 18, 2018 · 5 comments
Closed

default type doesn't work #12

alexakarpov opened this issue Sep 18, 2018 · 5 comments

Comments

@alexakarpov
Copy link

Hi all,

The README claims that 'type' key is optional for questions; it appear this statement is not true:
Running with a list of questions of this form:

questions = [
    {                                                                                              
        'type': 'input',
        'name': 'NAME',
        'message': 'Name:'
     },                                                                                           
    {
        'name': 'ASV',
        'message': 'ASV:'
     }
]

answers = prompt(questions)

leads to this interaction

? Name:  qwe
Traceback (most recent call last):
  File "./work.py", line 63, in <module>
    answers = prompt(questions)
  File "/usr/local/lib/python2.7/site-packages/PyInquirer/prompt.py", line 27, in prompt
    raise PromptParameterException('type')
PyInquirer.PromptParameterException: ('You must provide a `type` value', None)
@CITGuru
Copy link
Owner

CITGuru commented Sep 18, 2018

I think we need to update some part of the README.

@CITGuru
Copy link
Owner

CITGuru commented Sep 19, 2018

Can you point out where that is mentioned. You need to provide a type for every question

@CITGuru
Copy link
Owner

CITGuru commented Sep 19, 2018

I dont think that is mentioned in the README, I just looked through it lines by lines.

@CITGuru CITGuru closed this as completed Sep 19, 2018
@alexakarpov
Copy link
Author

sorry for the lag; I meant this line (perhaps I misunderstood it?):

type: (String) Type of the prompt. Defaults: input - Possible values: input, confirm, list, rawlist, expand, checkbox, password, editor

@CITGuru
Copy link
Owner

CITGuru commented Sep 20, 2018

Yea, I think that can also lead people astray. Unless we could add such functionality, but to make things clear, I'll just leave it to need a type by default.

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

2 participants