{"action":"created","issue":{"url":"https://api.github.com/repos/mitsuhiko/click/issues/218","labels_url":"https://api.github.com/repos/mitsuhiko/click/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/mitsuhiko/click/issues/218/comments","events_url":"https://api.github.com/repos/mitsuhiko/click/issues/218/events","html_url":"https://github.com/mitsuhiko/click/issues/218","id":42197642,"number":218,"title":"Option(prompt=True, multiple=True)","user":{"login":"kolypto","id":2234216,"avatar_url":"https://avatars.githubusercontent.com/u/2234216?v=3","gravatar_id":"","url":"https://api.github.com/users/kolypto","html_url":"https://github.com/kolypto","followers_url":"https://api.github.com/users/kolypto/followers","following_url":"https://api.github.com/users/kolypto/following{/other_user}","gists_url":"https://api.github.com/users/kolypto/gists{/gist_id}","starred_url":"https://api.github.com/users/kolypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolypto/subscriptions","organizations_url":"https://api.github.com/users/kolypto/orgs","repos_url":"https://api.github.com/users/kolypto/repos","events_url":"https://api.github.com/users/kolypto/events{/privacy}","received_events_url":"https://api.github.com/users/kolypto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitsuhiko/click/labels/bikeshedding","name":"bikeshedding","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-09-08T13:48:33Z","updated_at":"2015-11-13T18:50:43Z","closed_at":"2014-09-09T22:13:57Z","body":"Click's support for 'prompt' is great! And many thanks for the excellent library :)\r\n\r\nHowever, `prompt=True` does not play well with `multiple=True`.\r\n\r\nPlaying with this example:\r\n\r\n```python\r\nimport click\r\n\r\n@click.command()\r\n@click.option('-v', '--value', \r\n              prompt=True, multiple=True)\r\ndef cli(value):\r\n    print value  # just print the value\r\n\r\nif __name__ == '__main__':\r\n    # supporing env vars\r\n    cli.main(auto_envvar_prefix='TEST')\r\n```\r\n\r\nLet's first pass multiple options (it works):\r\n\r\n```console\r\n$ python cli.py -v1 -v2 -v3\r\n(u'1', u'2', u'3')\r\n```\r\n\r\nGreat, now let's test the prompt:\r\n\r\n```console\r\n$ python cli.py\r\nValue [()]: 1 2 3\r\n(u'1', u' ', u'2', u' ', u'3')\r\n```\r\n\r\nHmm, the input is not split using spaces!\r\n\r\nOkay, maybe environment variable does it better?\r\n\r\n```console\r\n$ TEST_VALUE=\"1 2 3\" python cli.py\r\n(u'1', u'2', u'3')\r\n```\r\n\r\nYes, it does!\r\n\r\n---\r\n\r\nI suggest to inherit the `auto_envvar_prefix` behavior by default, and also introduce a keyword that can preprocess a value *only* if it was taken from the prompt. \r\n\r\nOr even better, support a callable `prompt` keyword which accepts the same keyword arguments as `prompt=True` would set: it will enable the user to pass `click.prompt` with any custom settings:\r\n\r\n```python\r\n@click.option(prompt=lambda **kwargs: click.prompt(**kwargs))\r\ndef cli(value):\r\n    #...\r\n```\r\n\r\nOr at least prevent it from splitting the string as an iterable :)"},"comment":{"url":"https://api.github.com/repos/mitsuhiko/click/issues/comments/156521346","html_url":"https://github.com/mitsuhiko/click/issues/218#issuecomment-156521346","issue_url":"https://api.github.com/repos/mitsuhiko/click/issues/218","id":156521346,"user":{"login":"testn","id":445123,"avatar_url":"https://avatars.githubusercontent.com/u/445123?v=3","gravatar_id":"","url":"https://api.github.com/users/testn","html_url":"https://github.com/testn","followers_url":"https://api.github.com/users/testn/followers","following_url":"https://api.github.com/users/testn/following{/other_user}","gists_url":"https://api.github.com/users/testn/gists{/gist_id}","starred_url":"https://api.github.com/users/testn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testn/subscriptions","organizations_url":"https://api.github.com/users/testn/orgs","repos_url":"https://api.github.com/users/testn/repos","events_url":"https://api.github.com/users/testn/events{/privacy}","received_events_url":"https://api.github.com/users/testn/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T18:50:43Z","updated_at":"2015-11-13T18:50:43Z","body":"has there been some improvement to this problem? I would like to explore the option of sentinel such as blank line to stop accepting more values."}}