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
file() verification should be able to expand a leading tilde (~) #131
Comments
Or maybe this should be configurable at the Edit: But I have a slight preference to configure this on the |
BTW, I tried to work around the issue by doing
but that did not work as |
So the problem is that checks like It seems better to pass through what the user entered unchanged, but we should definitely expand tildes while we do the checks. |
Yes. I get |
What operating system and shell do you see this problem on? I expect that it's an issue in all cases, but it would be good to know if it's only affecting e.g. windows, which doesn't use the |
Yeah, I should have explained the use-case in more detail, apologies. Obviously everything is fine if an app using clikt is called from a regular command line prompt with a shell that supports tilde-expansion, as the shell performs the expansion before the app sees the path. The issue occurs when calling such an app programmatically, like from an IntelliJ IDEA Run Configuration. Out of habit I'm sometimes using paths with a I'd be perfectly fine if you say this is a non-feature that you would not like to add, but in that case I'd appreciate a hint why my work-around that chains |
Thanks for the clarification; the issue makes sense now. We can definitely expand tildes automatically when doing To answer your last question: |
Are you sure? |
Sorry about that, I misread your code. The reason it doesn't work is because The type system normally prevents you from calling convert more than once, since it |
Right, I remember about that, however that does not seem to help here as the wrapping (and thus the tilde expansion) seems to happen after the conversion to |
That's correct. I implemented the tilde expansion for file checks in #132, so you can use it with snapshot |
file()
currently fails for a path like~/my-file.txt
as~
is not expanded. It would be great if~
would be expanded when running on shells that support it similar to like we do here, maybe by introducing anexpandTilde
parameter tofile()
which defaults totrue
.The text was updated successfully, but these errors were encountered: