Skip to content
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

[BUG] Glob pattern that uses ** does not seem to work #1650

Open
1 task done
timkgh opened this issue Dec 19, 2024 · 2 comments
Open
1 task done

[BUG] Glob pattern that uses ** does not seem to work #1650

timkgh opened this issue Dec 19, 2024 · 2 comments
Labels

Comments

@timkgh
Copy link

timkgh commented Dec 19, 2024

Checks

  • I have read the troubleshooting section and still think this is a bug.

Describe the bug you encountered:

> fd -p foo.txt
bar/baz/foo.txt

> fd -p -g foo.txt
(no results) <-- ??

> fd -p -g '**/foo.txt'
bar/baz/foo.txt

> fd -p -g '/**/foo.txt'
bar/baz/foo.txt

> fd -p -g 'bar/**/foo.txt'
(no results) <-- ??

Are the two (no results) above supposed to work?

Describe what you expected to happen:

No response

What version of fd are you using?

fd 10.2.0

Which operating system / distribution are you on?

Darwin 23.6.0 arm64
@timkgh timkgh added the bug label Dec 19, 2024
@tavianator
Copy link
Collaborator

-p matches against the full absolute path, starting with /. And -g has to match the whole path. So these are both expected I think, but we could add a warning if the first character isn't / or *

@timkgh
Copy link
Author

timkgh commented Dec 19, 2024

-p matches against the full absolute path, starting with /

OK. A bit confusing because the output of the matches is relative to the current directory, it doesn't start with /. My assumption was that -p would match a substring of the full path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants