-
Notifications
You must be signed in to change notification settings - Fork 5
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
if pattern is absolute, don't transform it to relative by default (cf unix find) #23
Comments
Isn't that confusing? Shouldn't providing I see why it might not make sense to receive relative paths when your pattern's absolute, but IMO that's what the flag is for. |
the problem is current setup doesn't allow you to preserve absolute-ness of input pattern: if It not only is more flexible but is what is standard pretty much everywhere:
|
Alright I can be on board with that. So to summarize, here's how it should work:
|
BREAKING CHANGE: absolute patterns now result in absolute paths if no root is provided (even if `Absolute notin options` Closes #23
BREAKING CHANGE: absolute patterns now result in absolute paths if no root is provided (even if `Absolute notin options`) Closes #23
cd /tmp/foo
prints:
should print:
EDIT
so basically what I'm suggesting is to either change meaning of
GlobOption.Absolute
to have its default match behavior of unixfind
:Absolute = true:
all paths converted to absolute
Absolute = false and root = "" (the default)
if pattern in relative, stay relative
if pattern in absolute, stay absolute
Absolute = false and root != ""
all paths converted to be relative to root (using
relativePath
from nim-lang/Nim#8166 (comment) once ready; until then using whatever logic you have, which IIRC is currently different, as you don't allow ".." IIRC)/cc @citycide what do you think?
The text was updated successfully, but these errors were encountered: