Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I love
fd
, and use it almost daily. Especially do i love the easy-to-use-x
syntax.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
-x
syntax, 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
fd
in 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{}
Beta Was this translation helpful? Give feedback.
All reactions