Closed dawedawe closed 9 months ago
Hello,
For me, the problem reported in #2854 is not limited to flags.
For example, if I run dotnet fantomas dir1 dir2
where dir1
and dir2
doesn't exist.
Then fantomas creates these folders.
these input folders weren't found and then we treated these folders as output folders
This behaviour feels strange to me, this means if the user makes a typo then the command has a different behaviour than what he would expect.
If this is for legacy reason, that's unfortunate.
Otherwise, I think it would be nice to treat input folders as input only.
For example, if I run cd dir1
when dir1
doesn't exist, cd
doesn't try to create that folder. It report that the folder doesn't exist so I can fix my command invocation.
I pushed a change that should handle old flags and non-existing folders as @MangelMaxime described.
@MangelMaxime Please test our latest alpha It should handle your issues more gracefully.
I confirm that the alpha doesn't create the folder if it doesn't exist:
➜ Glutinum.Converter git:(main) ✗ dotnet fantomas di1 dir2
Input path 'di1' not found.
➜ Glutinum.Converter git:(main) ✗ dotnet fantomas src dir2
Input path 'dir2' not found.
# src folder exist
Thank you
fixes #2854
It's a bit complicated, but first we treated unknown flags as input folders these input folders weren't found and then we treated these folders as output folders these output folders didn't exist, so we created them, hence the famous
--recurse
folder came into life.