summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-06-24 23:08:30 (GMT)
committerYann Collet <cyan@fb.com>2019-06-24 23:08:30 (GMT)
commitbaf9b0e0434e1e516f468c4b96bde5bb38d4c737 (patch)
treecf5e4d5143c35c46aa20fe0ca327859b82185b51 /programs
parent798301b4e144fab5d25fc34566c1419685f5f1eb (diff)
downloadlz4-baf9b0e0434e1e516f468c4b96bde5bb38d4c737.zip
lz4-baf9b0e0434e1e516f468c4b96bde5bb38d4c737.tar.gz
lz4-baf9b0e0434e1e516f468c4b96bde5bb38d4c737.tar.bz2
fix #734 : --version should output to stdout
instead of stderr
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4cli.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 3619cd5..3b5d61e 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -67,6 +67,7 @@ static int g_lz4c_legacy_commands = 0;
/*-************************************
* Macros
***************************************/
+#define DISPLAYOUT(...) fprintf(stdout, __VA_ARGS__)
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); }
static unsigned displayLevel = 2; /* 0 : no display ; 1: errors only ; 2 : downgradable normal ; 3 : non-downgradable normal; 4 : + information */
@@ -390,7 +391,7 @@ int main(int argc, const char** argv)
if (!strcmp(argument, "--favor-decSpeed")) { LZ4IO_favorDecSpeed(prefs, 1); continue; }
if (!strcmp(argument, "--verbose")) { displayLevel++; continue; }
if (!strcmp(argument, "--quiet")) { if (displayLevel) displayLevel--; continue; }
- if (!strcmp(argument, "--version")) { DISPLAY(WELCOME_MESSAGE); return 0; }
+ if (!strcmp(argument, "--version")) { DISPLAYOUT(WELCOME_MESSAGE); return 0; }
if (!strcmp(argument, "--help")) { usage_advanced(exeName); goto _cleanup; }
if (!strcmp(argument, "--keep")) { LZ4IO_setRemoveSrcFile(prefs, 0); continue; } /* keep source file (default) */
if (!strcmp(argument, "--rm")) { LZ4IO_setRemoveSrcFile(prefs, 1); continue; }
@@ -437,7 +438,7 @@ int main(int argc, const char** argv)
switch(argument[0])
{
/* Display help */
- case 'V': DISPLAY(WELCOME_MESSAGE); goto _cleanup; /* Version */
+ case 'V': DISPLAYOUT(WELCOME_MESSAGE); goto _cleanup; /* Version */
case 'h': usage_advanced(exeName); goto _cleanup;
case 'H': usage_longhelp(exeName); goto _cleanup;