summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4.1.md3
-rw-r--r--programs/lz4cli.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/programs/lz4.1.md b/programs/lz4.1.md
index 48f3152..6f42904 100644
--- a/programs/lz4.1.md
+++ b/programs/lz4.1.md
@@ -194,6 +194,9 @@ only the latest one will be applied.
* `--rm` :
Delete source files on successful compression or decompression
+* `--` :
+ Treat all subsequent arguments as files
+
### Benchmark mode
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 0578bde..7a75f55 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -271,6 +271,7 @@ int main(int argc, const char** argv)
forceStdout=0,
main_pause=0,
multiple_inputs=0,
+ all_arguments_are_files=0,
operationResult=0;
operationMode_e mode = om_auto;
const char* input_filename = NULL;
@@ -315,7 +316,7 @@ int main(int argc, const char** argv)
if(!argument) continue; /* Protection if argument empty */
/* Short commands (note : aggregated short commands are allowed) */
- if (argument[0]=='-') {
+ if (!all_arguments_are_files && argument[0]=='-') {
/* '-' means stdin/stdout */
if (argument[1]==0) {
if (!input_filename) input_filename=stdinmark;
@@ -325,6 +326,7 @@ int main(int argc, const char** argv)
/* long commands (--long-word) */
if (argument[1]=='-') {
+ if (!strcmp(argument, "--")) { all_arguments_are_files = 1; continue; }
if (!strcmp(argument, "--compress")) { mode = om_compress; continue; }
if ((!strcmp(argument, "--decompress"))
|| (!strcmp(argument, "--uncompress"))) { mode = om_decompress; continue; }