summaryrefslogtreecommitdiffstats
path: root/programs/lz4cli.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-10-15 06:50:07 (GMT)
committerYann Collet <cyan@fb.com>2017-10-15 06:50:07 (GMT)
commitdccf8826f1d76efcbdc655e63cc04cdbd1123619 (patch)
tree636a4233618f7f47121f2bca99536f83bff49c53 /programs/lz4cli.c
parent1aa997b5942d5e7993c5c2b6c7b1a91dc5813ac8 (diff)
downloadlz4-dccf8826f1d76efcbdc655e63cc04cdbd1123619.zip
lz4-dccf8826f1d76efcbdc655e63cc04cdbd1123619.tar.gz
lz4-dccf8826f1d76efcbdc655e63cc04cdbd1123619.tar.bz2
lz4cli : minor rewrite of lz4c legacy commands
for clarity
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r--programs/lz4cli.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 05cb69f..362ba49 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -150,7 +150,7 @@ static int usage_advanced(const char* exeName)
DISPLAY( "Legacy arguments : \n");
DISPLAY( " -c0 : fast compression \n");
DISPLAY( " -c1 : high compression \n");
- DISPLAY( " -hc : high compression \n");
+ DISPLAY( " -c2,-hc: very high compression \n");
DISPLAY( " -y : overwrite output without prompting \n");
}
return 0;
@@ -205,14 +205,14 @@ static int usage_longhelp(const char* exeName)
DISPLAY( " generator | %s | consumer \n", exeName);
if (g_lz4c_legacy_commands) {
DISPLAY( "\n");
- DISPLAY( "***** Warning *****\n");
+ DISPLAY( "***** Warning ***** \n");
DISPLAY( "Legacy arguments take precedence. Therefore : \n");
- DISPLAY( "---------------------------------\n");
- DISPLAY( " %s -hc filename\n", exeName);
- DISPLAY( "means 'compress filename in high compression mode'\n");
- DISPLAY( "It is not equivalent to :\n");
- DISPLAY( " %s -h -c filename\n", exeName);
- DISPLAY( "which would display help text and exit\n");
+ DISPLAY( "--------------------------------- \n");
+ DISPLAY( " %s -hc filename \n", exeName);
+ DISPLAY( "means 'compress filename in high compression mode' \n");
+ DISPLAY( "It is not equivalent to : \n");
+ DISPLAY( " %s -h -c filename \n", exeName);
+ DISPLAY( "which displays help text and exits \n");
}
return 0;
}
@@ -368,10 +368,11 @@ int main(int argc, const char** argv)
if (g_lz4c_legacy_commands) {
/* Legacy commands (-c0, -c1, -hc, -y) */
- if ((argument[0]=='c') && (argument[1]=='0')) { cLevel=0; argument++; continue; } /* -c0 (fast compression) */
- if ((argument[0]=='c') && (argument[1]=='1')) { cLevel=9; argument++; continue; } /* -c1 (high compression) */
- if ((argument[0]=='h') && (argument[1]=='c')) { cLevel=9; argument++; continue; } /* -hc (high compression) */
- if (argument[0]=='y') { LZ4IO_setOverwrite(1); continue; } /* -y (answer 'yes' to overwrite permission) */
+ if (!strcmp(argument, "c0")) { cLevel=0; argument++; continue; } /* -c0 (fast compression) */
+ if (!strcmp(argument, "c1")) { cLevel=9; argument++; continue; } /* -c1 (high compression) */
+ if (!strcmp(argument, "c2")) { cLevel=12; argument++; continue; } /* -c2 (very high compression) */
+ if (!strcmp(argument, "hc")) { cLevel=12; argument++; continue; } /* -hc (very high compression) */
+ if (!strcmp(argument, "y")) { LZ4IO_setOverwrite(1); continue; } /* -y (answer 'yes' to overwrite permission) */
}
if ((*argument>='0') && (*argument<='9')) {