cli : add --help command
authorYann Collet <cyan@fb.com>
Sun, 13 Nov 2016 01:21:29 +0000 (17:21 -0800)
committerYann Collet <cyan@fb.com>
Sun, 13 Nov 2016 01:21:29 +0000 (17:21 -0800)
NEWS
programs/lz4.1
programs/lz4cli.c

diff --git a/NEWS b/NEWS
index 94bbc3a..054265c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ Fix : better ratio on 64-bits big-endian targets
 Improved cmake build script, by Evan Nemerson
 New liblz4-dll project, by Przemyslaw Skibinki
 Makefile: Generates object files (*.o) for faster (re)compilation on low power systems
-cli : new : --rm command
+cli : new : --rm and --help commands
 cli : new : preserved file attributes, by Przemyslaw Skibinki
 cli : fix : crash on some invalid inputs
 cli : fix : -t correctly validates lz4-compressed files, by Nick Terrell
index 1d9238d..434b131 100644 (file)
@@ -217,7 +217,7 @@ hence for a file. It won't work with unknown source size, such as stdin or pipe.
 .BR \-q ", " --quiet
  suppress warnings and real-time statistics; specify twice to suppress errors too
 .TP
-.B \-h/\-H
+.B \-h/\-H ", " --help
  display help/long help and exit
 .TP
 .BR \-V ", " \--version
index 1f25a21..d291a27 100644 (file)
@@ -353,6 +353,7 @@ int main(int argc, const char** argv)
                 if (!strcmp(argument,  "--version")) { DISPLAY(WELCOME_MESSAGE); return 0; }
                 if (!strcmp(argument,  "--keep")) { LZ4IO_setRemoveSrcFile(0); continue; }   /* keep source file (default) */
                 if (!strcmp(argument,  "--rm")) { LZ4IO_setRemoveSrcFile(1); continue; }
+                if (!strcmp(argument,  "--help")) { usage_advanced(exeName); goto _cleanup; }
             }
 
             while (argument[1]!=0) {