summaryrefslogtreecommitdiffstats
path: root/programs/lz4cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r--programs/lz4cli.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index e05a9a9..fd2721d 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -344,6 +344,19 @@ int main(int argc, char** argv)
if (*argument=='s') { displayLevel=1; continue; } // -s (silent mode)
#endif // DISABLE_LZ4C_LEGACY_OPTIONS
+ if ((*argument>='0') && (*argument<='9'))
+ {
+ cLevel = 0;
+ while ((*argument >= '0') && (*argument <= '9'))
+ {
+ cLevel *= 10;
+ cLevel += *argument - '0';
+ argument++;
+ }
+ argument--;
+ continue;
+ }
+
switch(argument[0])
{
// Display help
@@ -354,20 +367,6 @@ int main(int argc, char** argv)
// Compression (default)
case 'z': forceCompress = 1; break;
- // Compression level
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A': /* non documented (hidden) */
- cLevel=*argument -'0'; break;
-
// Use Legacy format (for Linux kernel compression)
case 'l': legacy_format=1; break;