replace-in-files-cli icon indicating copy to clipboard operation
replace-in-files-cli copied to clipboard

Add dry run option

Open madnight opened this issue 6 years ago • 4 comments

If the dry run option is set, then no changes should happen, instead it should list all changes that would happen.

madnight avatar Jun 17 '19 12:06 madnight

Can you show an example of how that would look like? How would it list the changes?

sindresorhus avatar Jun 17 '19 14:06 sindresorhus

@sindresorhus I imagine sth like ripgrep is best; You can then show the replacement in another color. (I suggest using background colors, too.) This dryrun feature is essential for a calm replacement :D. image

NightMachinery avatar Apr 16 '20 16:04 NightMachinery

@NightMachinary I like it 👍


This dryrun feature is essential for a calm replacement :D.

Sure. However, this CLI is really meant to be used in run scripts of packages/apps, where you're already using Git, so you can always just revert the commit / working directory if you did something wrong.

sindresorhus avatar Apr 16 '20 17:04 sindresorhus

Yup, I also like @NightMachinary proposal. Maybe one could also add a interactive mode, where the user has to confirm (y/n) each replacement.

madnight avatar Jun 03 '20 11:06 madnight