cli: display a warning whenever default output is stdout while input != stdin
authorYann Collet <cyan@fb.com>
Sat, 20 Apr 2019 00:08:40 +0000 (17:08 -0700)
committerYann Collet <cyan@fb.com>
Sat, 20 Apr 2019 00:08:40 +0000 (17:08 -0700)
commit5f8ac02b7707c03f93ff10ac1362d2c618bd3c42
tree2b007309534f4a65111bd12711ae29e99b584832
parent7a4e3b1fac5cd9d4ec7c8d0091329ba107ec2131
cli: display a warning whenever default output is stdout while input != stdin

This behavior has been preserved for compatibility with existing ecosystem.
But it's problematic, as some environment start `lz4` without identifying stdout as console by default,
leading to a change of behavior for a same line of script.

A more sensible policy would be to default to stdout only when input is stdin.

Soft change for the time being : keep the behavior, just print a warning message.
User should prefer `-c` to explicitly select `stdout`.

Also : updated tests in Makefile to explicitly select `stdout` with `-c`.
programs/lz4cli.c
tests/Makefile