-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow disabling pattern expansion on Windows #1901
Comments
I looked into the code and it appears nested commands will have already received expanded arguments so |
Can you provide an example of what goes wrong, so we can explain better in the changelog? Also, there was some discussion of escaping in the original issue, maybe it can help? |
Basic example:
now would run On Linux we can do:
but on Windows the Click args become |
Not ideal, I understand, but the original feature request discussed escaping #1096 (comment)
|
Actually, us Windows users are accustomed to CLIs not supporting expansion by default 😉
What about I guess the point I'm trying to stress is that certain inputs can no longer be achieved in a cross-platform way |
Pinging @njsmith and @asweigart for their thoughts since they participated in the original discussion. Due to the way the processing pipeline works, the expansion has to be done at the beginning, before any parsing of the command line is done. This would be an all or nothing toggle, either no expansion happens for any command, or it happens for every command. |
Thank you!!! |
A follow up to this is #2195, which points out that we could assume any error in glob expansion on Windows could be treated the same as no glob expansion: keep that arg as-is. So in that case you might be able to leave expansion enabled for your app. |
TL;DR
Essentially, make this optional: #1830
Use case
We have a command that passes arbitrary arguments to be executed in other contexts such as Docker containers, servers over SSH, etc.
On Windows since Click 8.0 this breaks (depending on files in cwd, etc.) and unlike on Linux we can't just escape special characters
Implementation
Setting could be called
disable_pattern_expansion
, e.g.:The text was updated successfully, but these errors were encountered: