sd icon indicating copy to clipboard operation
sd copied to clipboard

Feature request: REPL mode

Open oriongonza opened this issue 2 years ago • 3 comments

This is very easy to implement and allows for easier debugging.

I can implement this as soon as 1.0 has been branched.

oriongonza avatar Oct 31 '23 08:10 oriongonza

Conveniently enough I was just giving this some thought yesterday. Related:

  • #79
  • #167

My current idea for UI is similar to what git checkout -p does where it displays a diff showing the change on a single chunk (for us we would probably show a prompt on every single replacement), and then you have an input where the user can select applying that change to all found values, applying that change to a single value, skipping a single value, and quitting

Is that similar to what you had in mind?

CosmicHorrorDev avatar Oct 31 '23 18:10 CosmicHorrorDev

Honestly I was thinking about what sed does already: sed "s/foo/bar/g" launches you into some sort of repl mode. You input a line and you get the result, and since we have the colored output already the user experience should be nice enough. We would need the line by line mode (I opened a PR for it already)

oriongonza avatar Nov 01 '23 16:11 oriongonza

Ah yes, that's just sed reading from stdin. We should be able to support the same once your line by line mode PR is merged

CosmicHorrorDev avatar Nov 01 '23 16:11 CosmicHorrorDev