marcusbuffett / pipe-rename

Rename your files using your favorite text editor
https://crates.io/crates/pipe-rename
MIT License
397 stars 12 forks source link

Support other rename methods, e. g. git mv #1

Closed robinkrahl closed 4 years ago

robinkrahl commented 4 years ago

I really like this approach for bulk renaming! It would be nice to be able to use this with git mv. Currently, I can call pipe-rename and then git add -A, but this only works if there are no unstaged changes.

What do you think about adding a --rename-command option so that I could call ls * | renamer --rename-command "git mv"?

marcusbuffett commented 4 years ago

I like it! Cool idea. I can take a crack at this in the next couple days, or feel free to submit a PR

marcusbuffett commented 4 years ago

This should be covered by ec1576a3aa6d69d922ef57e35d5145b2b9dd491f . Ex: ls | renamer --rename-command="git mv" or ls | renamer -c="git mv"

Gonna close this issue but lmk if this doesn't fit your use case and I'll re-open. Thanks for the idea!

robinkrahl commented 4 years ago

Nice, thank you! I think this might cause some issues with strange file names (e. g. starting with -), but I’ll double-check that.

marcusbuffett commented 4 years ago

Ah I think you're right, the files should be passed as args probably instead, or escaped in some way