diff2html-cli icon indicating copy to clipboard operation
diff2html-cli copied to clipboard

'--renderNothingWhenEmpty' didn't work when using 'stdin' as input

Open Ps7ch3 opened this issue 3 years ago • 1 comments

$ echo "123" > /tmp/test
 
$ diff -u /tmp/test /tmp/test | diff2html --renderNothingWhenEmpty -i stdin -s side -F diff.html 
The input is empty. Try again. []
Usage: diff2html [options] -- [diff args]

Options:
  -s, --style                            Output style
                                     [choices: "line", "side"] [default: "line"]
      --fileContentToggle, --fct         Show viewed checkbox to toggle file
...
...
...

I wonder if there is a way to get the display content like in this issue when using 'stdin' as input source

  • https://github.com/rtfpessoa/diff2html/issues/212

Ps7ch3 avatar Aug 03 '22 09:08 Ps7ch3

👋 @Ps7ch3 this option is not exactly for this case. It just works when you have a diff but it has no chunks.

In your case you have no diff, literally no content.

This could be tweaked I guess.

It would be fine for me to allow this flag to not fail if content is empty.

Feel free to send a PR

rtfpessoa avatar Sep 02 '22 21:09 rtfpessoa