Replies: 2 comments 2 replies
|
Thank you for writing this up. Our syntax is based on that of GNU parallel (https://www.gnu.org/software/parallel/), so I'd rather not introduce any breaking changes, because that would also mean we're not compatible with But maybe we can study their documentation/issue tracker to see if there are extensions to the syntax we have in |
|
A common pattern i run into is the ability to do search/replace in a path. For example, if I have many test fixtures in It might be better to have a regex search/replace pattern right in the example for the above: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I love
fd, and use it almost daily. Especially do i love the easy-to-use-xsyntax.But i do often find myself doing tricks like
fd ... -x sh -c 'foobar "$(basename "{//}")"'to get the basename of the parent directory.I decided to have a look at the
-xsyntax, and I propose this extension:The changes are:
/to-, as it conflicts with parent name, deprecating the old syntax/and.(related: -x option with basename format doesn't seem to work with extensions with two.in them #911)This will change the general find-replace regex match from
\{/*\.*\}to\{/*-?.*\}.I kept two deprecations for backward-compatibility, as people most likely use
fdin in scripts. After a while, the documentation of the deprecated syntax could be removed, but we could keep their implementation and yield a warning.Also something we could discuss: Should it be possible to escape the syntax? Something like
fd . -x echo "{}\{}"could printmyfile.txt{}All reactions