-x option with basename format doesn't seem to work with extensions with two `.` in them
What version of fd are you using?
fd 8.2.1
I'm trying to find TypeScript files (.ts) that have the same basename as a TypeScript declaration file.
fd --extension 'd.ts' -x ls {.}.ts
This outputs basename.d.d.ts in zsh. is this it possible to output basename.d.ts?
I think that would probably require either a separate format, or an option to enable that behavior, because it is also fairly common to have filenames where there is a . in the basename that should be included.
Or maybe if the {.} format is used and there is also an --extensions option that includes a dot, then that suffix should be removed if it matches?
@tmccombs
Or maybe if the {.} format is used and there is also an --extensions option that includes a dot, then that suffix should be removed if it matches?
This is what I'd expect, I think.
Hm. I would rather argue that the behavior should not not change, just because there is a --extension filter. I think that might be unexpected.
I would propose that we introduce a new format for this. How about . for removing a single file extension (like we do already) and .. for removing all file extensions? We would then add both {..} and {/..}.
That seems reasonable to me