-
Notifications
You must be signed in to change notification settings - Fork 10
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
ls
shell-like wildcards
#302
Conversation
4d62cec
to
8c821a6
Compare
122a880
to
4de6ac7
Compare
dd68b87
to
8309ca0
Compare
ls
, rm
shell-like wildcards
ls
, rm
shell-like wildcardsls
shell-like wildcards
b2sdk/utils/wildcards.py
Outdated
| wcglob.NEGATE # support [!] for negation | ||
) | ||
wildcard_matcher = partial( | ||
lambda file_name: wcglob.globmatch(file_name, match_pattern, flags=wc_flags, limit=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This limit (lowered from 1000 to 100) is hardcoded and undocumented. I'm afraid it will bite someone in the ass one day. Can we set it to a value that won't ever trigger (with the limitation of file name / object length) or expose it so that the user can increase it if they have a weird use case? Otherwise sooner or later someone will hit it, report a bug and we'll have to figure out a way to fix it then. Why did you decide to set it to a 100?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This limit (lowered from 1000 to 100) is hardcoded and undocumented
using wcmatch
can be considered an implementation detail, in which case even the limit 1000 is undocumented/hardcoded.
Why did you decide to set it to a 100?
the docs had a warning there "Massive Expansion Risk" which made me think what would be a common use-case this feature might be covering - either expanding a-z, or expanding 0-99. I went with the latter one.
I dont have strong opinion about this, so I'll revert it to 1000, which sounds loose enough.
Co-authored-by: Paweł Polewicz <p.polewicz@gmail.com>
Co-authored-by: Paweł Polewicz <p.polewicz@gmail.com>
Co-authored-by: Paweł Polewicz <p.polewicz@gmail.com>
Co-authored-by: Paweł Polewicz <p.polewicz@gmail.com>
superseeded by other ls&rm PRs |
Since the task is quite big, I split it into multiple PRs per command.
ls
shell-like wildcards B2_Command_Line_Tool#194 (pipeline wont pass until this will get merged)Changes
ls
*
,**
,?
,[]
,{}
globs/patterns inb2 ls
, globbing should work similarly to bash globs. Allow escaping special symbols with backslash\
.