Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
File option - prompting with pretty default? #914
import click import os.path @click.command() @click.option('-f', default=os.path.realpath("subdir/file.txt"), prompt="Please provide a file", type=click.File('rt')) def func(f): pass func()
But when I call it, it produces prompt like this:
Is this solved anywhere or how difficult would it be to fix it, so it would show
Please excuse any imperfections of this issue, I'm quite new to GitHub and haven't written any issues yet...
Can't reproduce on Mac - Python 3.6.2, Click 6.7...
Okay - I see it now @mvolfik.
The problem seems to be here.
There is only one value returned,
So, while the output would be as expected, it would produce the wrong result if you were to try something like
The long and the short of it is that I got a bit lost, and I'm sorry I wasn't able to help more, but it seems like an actual bug, and a tricky one at that. I'm very curious to see how this is solved either way.