cli53 icon indicating copy to clipboard operation
cli53 copied to clipboard

Improve `--dry-run` diff

Open nickv2002 opened this issue 1 year ago • 1 comments

Issue type

  • Feature idea

cli53 version (cli53 --version)

cli53: stable 0.8.22 (bottled)

OS / Platform

Mac 14.3.1

Steps to reproduce

I added one text record (and new line) to a zone file that I exported out of cli53 then I used the command below to preview what it would look like when re-adding.

Example output:

cli53 import --wait --dry-run --file ./example.com.zone --replace example.com
Dry-run, changes that would be made:
+ example.com.        300     IN      TXT     "MS=ms1234"
+ example.com.        300     IN      TXT     "google-site-verification=asdf"
- example.com.        300     IN      TXT     "MS=ms1234"

In the abridged and simplified output, you can see that the same MS=ms1234 TXT record is shown as both removed and added, but there are other non-changing entries that don't show up. This is confusing output because the order doesn't matter (AFAIK) and the output changes each time I run a dry-run.

Expected behaviour

Just show the changes in a consistent order

cli53 import --wait --dry-run --file ./example.com.zone --replace example.com
Dry-run, changes that would be made:
+ example.com.        300     IN      TXT     "google-site-verification=asdf"

Actual behaviour

See example above.

Have you checked if the documentation has the information you require?

I looked for sort and dedupe options but didn't find any.

Could you contribute a fix or help testing with this issue?

I could test easily.

Suggestion

Seems like a simple sort should work here. Probably the same for cli53 export.

nickv2002 avatar Mar 06 '24 19:03 nickv2002

This is related to https://github.com/barnybug/cli53/issues/299#issuecomment-670950246 That was marked resolved, but I think it's still worth improving the output here.

nickv2002 avatar Nov 23 '24 00:11 nickv2002