summaryrefslogtreecommitdiffstats
path: root/programs/lz4cli.c
diff options
context:
space:
mode:
authorPrzemyslaw Skibinski <inikep@gmail.com>2016-11-07 13:50:58 (GMT)
committerPrzemyslaw Skibinski <inikep@gmail.com>2016-11-07 13:50:58 (GMT)
commitef54f9f9dd5d69ab69a085f25adaf4ce4533fe5c (patch)
tree126130d7baab1481a6c228746a35c664244fbfff /programs/lz4cli.c
parentd61bb74f2044fed546de21f5b1e39737d79b8e48 (diff)
downloadlz4-ef54f9f9dd5d69ab69a085f25adaf4ce4533fe5c.zip
lz4-ef54f9f9dd5d69ab69a085f25adaf4ce4533fe5c.tar.gz
lz4-ef54f9f9dd5d69ab69a085f25adaf4ce4533fe5c.tar.bz2
added --rm option
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r--programs/lz4cli.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 9625640..f091d3a 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -149,6 +149,7 @@ static int usage(void)
DISPLAY( " -d : decompression (default for %s extension)\n", LZ4_EXTENSION);
DISPLAY( " -z : force compression\n");
DISPLAY( " -f : overwrite output without prompting \n");
+ DISPLAY( "--rm : remove source file(s) after successful de/compression \n");
DISPLAY( " -h/-H : display help/long help and exit\n");
return 0;
}
@@ -340,7 +341,8 @@ int main(int argc, const char** argv)
if (!strcmp(argument, "--verbose")) { displayLevel=4; continue; }
if (!strcmp(argument, "--quiet")) { if (displayLevel) displayLevel--; continue; }
if (!strcmp(argument, "--version")) { DISPLAY(WELCOME_MESSAGE); return 0; }
- if (!strcmp(argument, "--keep")) { continue; } /* keep source file (default anyway; just for xz/lzma compatibility) */
+ if (!strcmp(argument, "--keep")) { LZ4IO_setRemoveSrcFile(0); continue; } /* keep source file (default anyway; just for xz/lzma compatibility) */
+ if (!strcmp(argument, "--rm")) { LZ4IO_setRemoveSrcFile(1); continue; }
/* Short commands (note : aggregated short commands are allowed) */
if (argument[0]=='-') {
@@ -406,7 +408,7 @@ int main(int argc, const char** argv)
case 'q': if (displayLevel) displayLevel--; break;
/* keep source file (default anyway, so useless) (for xz/lzma compatibility) */
- case 'k': break;
+ case 'k': LZ4IO_setRemoveSrcFile(0); break;
/* Modify Block Properties */
case 'B':