added long comment --memlimit=
diff --git a/programs/zstdcli.c b/programs/zstdcli.c
index 3a284c3..9a38ede 100644
--- a/programs/zstdcli.c
+++ b/programs/zstdcli.c
@@ -247,16 +247,16 @@
if (!strcmp(programName, ZSTD_CAT)) { decode=1; forceStdout=1; displayLevel=1; outFileName=stdoutmark; }
/* command switches */
- for(argNb=1; argNb<argCount; argNb++) {
+ for (argNb=1; argNb<argCount; argNb++) {
const char* argument = argv[argNb];
if(!argument) continue; /* Protection if argument empty */
if (nextArgumentIsFile==0) {
/* long commands (--long-word) */
- if (!strcmp(argument, "--")) { nextArgumentIsFile=1; continue; }
+ if (!strcmp(argument, "--")) { nextArgumentIsFile=1; continue; } /* only file names allowed from now on */
if (!strcmp(argument, "--decompress")) { decode=1; continue; }
- if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
+ if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
if (!strcmp(argument, "--version")) { displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); }
if (!strcmp(argument, "--help")) { displayOut=stdout; CLEAN_RETURN(usage_advanced(programName)); }
if (!strcmp(argument, "--verbose")) { displayLevel++; continue; }
@@ -275,6 +275,13 @@
if (!strcmp(argument, "--keep")) { FIO_setRemoveSrcFile(0); continue; }
if (!strcmp(argument, "--rm")) { FIO_setRemoveSrcFile(1); continue; }
+ /* long commands with arguments */
+ if (!strncmp(argument, "--memlimit=", strlen("--memlimit="))) {
+ argument += strlen("--memlimit=");
+ memLimit = readU32FromChar(&argument);
+ continue;
+ }
+
/* '-' means stdin/stdout */
if (!strcmp(argument, "-")){
if (!filenameIdx) {