Closed frsche closed 3 years ago
I think the prompt shouldn't have that much logic, also the is_successful
parameters name is confusing in my opinion.
What about this alternative: move the possible_selection
vec outside of the prompt
function, and simply give it as a parameter?
This way:
Other things I'm thinking:
possible_selection
vec, does it have to be a vec? We never try to modify it, so it could be a basic array, no?rusty
/rust-like
to use an enum here, not strings. (but it might not be ideal though, if the thing that does the prompt require strings..) Makes a lot of sense to me, agree just aborting is wrong. I do think eliminating the "Yes" option when there are conflicts is a bit overkill, I can imagine use cases where you'd be fine with overwriting existing files. I'm going to merge this then just add the "Yes" option back in, but not as the first option, so people don't just mindlessly hit enter and lose files. Thank you for the contribution!
Published a new version w/ this :+1: 1.4.0 has this update
Hello!
Currently, the program aborts when there will be a collision with the renamed files. I think it is more convenient to allow the user to fix the current renaming, instead of expecting him to do all the renaming again.
This pull request hides the "Yes" answer when there is a collision with the filenames. This allows the user to select the "Edit" or "Reset" option to fix the collision. When the
--yes
option is given, the program aborts when there is a collision (so that it is never interactive with--yes
).I have also changed the color in which the collisions are shown to red so that it is more obvious that something went wrong.