• Home
  • Raw
  • Download

Lines Matching +full:continue +full:- +full:on +full:- +full:error

2   LZ4cli - LZ4 Command Line Interface
3 Copyright (C) Yann Collet 2011-2023
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 - LZ4 source repository : https://github.com/lz4/lz4
23 - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
26 Note : this is stand-alone program.
34 /*-************************************
50 #include "lz4conf.h" /* compile-time constants */
63 # define IO_MT "single-thread"
67 #define WELCOME_MESSAGE "*** %s v%s %i-bit %s, by %s ***\n", COMPRESSOR_NAME, LZ4_versionString(), …
79 /*-************************************
85 … 2; /* 0 : no display ; 1: errors only ; 2 : downgradable normal ; 3 : non-downgradable normal; …
88 /*-************************************
95 #define END_PROCESS(error, ...) \ argument
97 DEBUGOUTPUT("Error in %s, line %i : \n", __FILE__, __LINE__); \
98 DISPLAYLEVEL(1, "Error %i : ", error); \
101 exit(error); \
110 /*-************************************
121 /*-***************************
130 DISPLAY( " with no FILE, or when FILE is - or %s, read standard input\n", stdinmark); in usage()
132 DISPLAY( " -1 : fast compression (default) \n"); in usage()
133 DISPLAY( " -%2d : slowest compression level \n", LZ4HC_CLEVEL_MAX); in usage()
134 … DISPLAY( " -T# : use # threads for compression (default:%i==auto) \n", LZ4_NBWORKERS_DEFAULT); in usage()
135 DISPLAY( " -d : decompression (default for %s extension)\n", LZ4_EXTENSION); in usage()
136 DISPLAY( " -f : overwrite output without prompting \n"); in usage()
137 DISPLAY( " -k : preserve source files(s) (default) \n"); in usage()
138 DISPLAY( "--rm : remove source file(s) after successful de/compression \n"); in usage()
139 DISPLAY( " -h/-H : display help/long help and exit \n"); in usage()
149 DISPLAY( " -V : display Version number and exit \n"); in usage_advanced()
150 DISPLAY( " -v : verbose mode \n"); in usage_advanced()
151 DISPLAY( " -q : suppress warnings; specify twice to suppress errors too\n"); in usage_advanced()
152 DISPLAY( " -c : force write to standard output, even if it is the console\n"); in usage_advanced()
153 DISPLAY( " -t : test compressed file integrity\n"); in usage_advanced()
154 DISPLAY( " -m : multiple input files (implies automatic output filenames)\n"); in usage_advanced()
156 DISPLAY( " -r : operate recursively on directories (sets also -m) \n"); in usage_advanced()
158 DISPLAY( " -l : compress using Legacy format (Linux kernel compression)\n"); in usage_advanced()
159 DISPLAY( " -z : force compression \n"); in usage_advanced()
160 DISPLAY( " -D FILE: use FILE as dictionary (compression & decompression)\n"); in usage_advanced()
161 DISPLAY( " -B# : cut file into blocks of size # bytes [32+] \n"); in usage_advanced()
162 …DISPLAY( " or predefined block size [4-7] (default: %i) \n", LZ4_BLOCKSIZEID_D… in usage_advanced()
163 DISPLAY( " -BI : Block Independence (default) \n"); in usage_advanced()
164 DISPLAY( " -BD : Block dependency (improves compression ratio) \n"); in usage_advanced()
165 DISPLAY( " -BX : enable block checksum (default:disabled) \n"); in usage_advanced()
166 DISPLAY( "--no-frame-crc : disable stream checksum (default:enabled) \n"); in usage_advanced()
167 DISPLAY( "--content-size : compressed frame includes original size (default:not present)\n"); in usage_advanced()
168 …DISPLAY( "--list FILE : lists information about .lz4 files (useful for files compressed with --con… in usage_advanced()
169 DISPLAY( "--[no-]sparse : sparse mode (default:enabled on file, disabled on stdout)\n"); in usage_advanced()
170 DISPLAY( "--favor-decSpeed: compressed files decompress faster, but are less compressed \n"); in usage_advanced()
171 DISPLAY( "--fast[=#]: switch to ultra fast compression level (default: %i)\n", 1); in usage_advanced()
172 DISPLAY( "--best : same as -%d\n", LZ4HC_CLEVEL_MAX); in usage_advanced()
174 DISPLAY( " -b# : benchmark file(s), using # compression level (default : 1) \n"); in usage_advanced()
175 DISPLAY( " -e# : test all compression levels from -bX to # (default : 1)\n"); in usage_advanced()
176 DISPLAY( " -i# : minimum evaluation time in seconds (default : 3s) \n"); in usage_advanced()
179 DISPLAY( " -c0 : fast compression \n"); in usage_advanced()
180 DISPLAY( " -c1 : high compression \n"); in usage_advanced()
181 DISPLAY( " -c2,-hc: very high compression \n"); in usage_advanced()
182 DISPLAY( " -y : overwrite output without prompting \n"); in usage_advanced()
196 DISPLAY( "---------------------------------\n"); in usage_longhelp()
198 DISPLAY( " '%s', or '-' for standard output (pipe mode)\n", stdoutmark); in usage_longhelp()
201 DISPLAY( " - if stdout is not the console, then [output] = stdout \n"); in usage_longhelp()
202 DISPLAY( " - if stdout is console : \n"); in usage_longhelp()
205 …DISPLAY( " > if input filename has no '%s' extension : error \n", LZ4_EXTENSION… in usage_longhelp()
208 DISPLAY( "---------------------\n"); in usage_longhelp()
209 DISPLAY( "-0 ... -2 => Fast compression, all identical\n"); in usage_longhelp()
210 …DISPLAY( "-3 ... -%d => High compression; higher number == more compression but slower\n", LZ4HC_C… in usage_longhelp()
213 DISPLAY( "--------------------------------\n"); in usage_longhelp()
216 DISPLAY( "except if '-c' command is specified, to force output to console \n"); in usage_longhelp()
219 DISPLAY( "----------------\n"); in usage_longhelp()
224 DISPLAY( "----------------------------------\n"); in usage_longhelp()
226 DISPLAY( " %s -9 -f filename \n", exeName); in usage_longhelp()
228 DISPLAY( " %s -9f filename \n", exeName); in usage_longhelp()
231 DISPLAY( "-------------------------------------\n"); in usage_longhelp()
238 DISPLAY( "--------------------------------- \n"); in usage_longhelp()
239 DISPLAY( " %s -hc filename \n", exeName); in usage_longhelp()
242 DISPLAY( " %s -h -c filename \n", exeName); in usage_longhelp()
258 DISPLAY("Press enter to continue...\n"); in waitEnter()
271 @return : a non-zero value if exeName matches test, excluding the extension
289 result += (unsigned)(**stringPtr - '0'); in readU32FromChar()
311 DISPLAYLEVEL(1, "error: missing command argument \n"); \
316 if (ptr[0]=='-') { \
317 … DISPLAYLEVEL(1, "error: command cannot be separated from its argument by another command \n"); \
326 …errorOut("error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed"); \
346 * auto-determine operation mode, based on input filename extension
353 size_t const extStart= (inSize > extSize) ? inSize-extSize : 0; in determineOpMode()
392 cLevelLast=-10000, in main()
420 DISPLAY("Allocation error : not enough memory \n"); in main()
427 /* predefined behaviors, based on binary/link name */ in main()
445 if(!argument) continue; /* Protection if argument empty */ in main()
448 if (!all_arguments_are_files && argument[0]=='-') { in main()
449 /* '-' means stdin/stdout */ in main()
453 continue; in main()
456 /* long commands (--long-word) */ in main()
457 if (argument[1]=='-') { in main()
458 if (!strcmp(argument, "--")) { all_arguments_are_files = 1; continue; } in main()
459 if (!strcmp(argument, "--compress")) { mode = om_compress; continue; } in main()
460 if ( (!strcmp(argument, "--decompress")) in main()
461 || (!strcmp(argument, "--uncompress"))) { in main()
464 continue; in main()
466 if (!strcmp(argument, "--multiple")) { multiple_inputs = 1; continue; } in main()
467 if (!strcmp(argument, "--test")) { mode = om_test; continue; } in main()
468 if (!strcmp(argument, "--force")) { LZ4IO_setOverwrite(prefs, 1); continue; } in main()
469 if (!strcmp(argument, "--no-force")) { LZ4IO_setOverwrite(prefs, 0); continue; } in main()
470 if ((!strcmp(argument, "--stdout")) in main()
471 … || (!strcmp(argument, "--to-stdout"))) { forceStdout=1; output_filename=stdoutmark; continue; } in main()
472 …if (!strcmp(argument, "--frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 1); BMK_skipChecksums(… in main()
473 …if (!strcmp(argument, "--no-frame-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); BMK_skipChecksu… in main()
474 …cmp(argument, "--no-crc")) { LZ4IO_setStreamChecksumMode(prefs, 0); LZ4IO_setBlockChecksumMode(pr… in main()
475 … if (!strcmp(argument, "--content-size")) { LZ4IO_setContentSize(prefs, 1); continue; } in main()
476 … if (!strcmp(argument, "--no-content-size")) { LZ4IO_setContentSize(prefs, 0); continue; } in main()
477 if (!strcmp(argument, "--list")) { mode = om_list; multiple_inputs = 1; continue; } in main()
478 if (!strcmp(argument, "--sparse")) { LZ4IO_setSparseFile(prefs, 2); continue; } in main()
479 if (!strcmp(argument, "--no-sparse")) { LZ4IO_setSparseFile(prefs, 0); continue; } in main()
480 … if (!strcmp(argument, "--favor-decSpeed")) { LZ4IO_favorDecSpeed(prefs, 1); continue; } in main()
481 if (!strcmp(argument, "--verbose")) { displayLevel++; continue; } in main()
482 if (!strcmp(argument, "--quiet")) { if (displayLevel) displayLevel--; continue; } in main()
483 if (!strcmp(argument, "--version")) { DISPLAYOUT(WELCOME_MESSAGE); goto _cleanup; } in main()
484 if (!strcmp(argument, "--help")) { usage_advanced(exeName); goto _cleanup; } in main()
485 …if (!strcmp(argument, "--keep")) { LZ4IO_setRemoveSrcFile(prefs, 0); continue; } /* keep source… in main()
486 if (!strcmp(argument, "--rm")) { LZ4IO_setRemoveSrcFile(prefs, 1); continue; } in main()
488 if (longCommandWArg(&argument, "--threads")) { in main()
490 continue; in main()
492 if (longCommandWArg(&argument, "--fast")) { in main()
499 cLevel = -(int)fastLevel; in main()
504 /* Invalid character following --fast */ in main()
507 cLevel = -1; /* default for --fast */ in main()
509 continue; in main()
513 if (!strcmp(argument, "--best")) { cLevel=LZ4HC_CLEVEL_MAX; continue; } in main()
520 /* Legacy commands (-c0, -c1, -hc, -y) */ in main()
521 … if (!strcmp(argument, "c0")) { cLevel=0; argument++; continue; } /* -c0 (fast compression) */ in main()
522 … if (!strcmp(argument, "c1")) { cLevel=9; argument++; continue; } /* -c1 (high compression) */ in main()
523 …if (!strcmp(argument, "c2")) { cLevel=12; argument++; continue; } /* -c2 (very high compression) … in main()
524 …if (!strcmp(argument, "hc")) { cLevel=12; argument++; continue; } /* -hc (very high compression) … in main()
525 …if (!strcmp(argument, "y")) { LZ4IO_setOverwrite(prefs, 1); continue; } /* -y (answer 'yes' to o… in main()
530 argument--; in main()
531 continue; in main()
545 argument--; in main()
555 argument--; in main()
572 argument += strlen(argument) - 1; in main()
601 case 'q': if (displayLevel) displayLevel--; break; in main()
623 argument--; in main()
658 /* fall-through */ in main()
659 …/* Treat non-option args as input files. See https://code.google.com/p/lz4/issues/detail?id=151 */ in main()
668 argument--; in main()
681 continue; in main()
684 /* Store in *inFileNames[] if -m is used. */ in main()
685 if (multiple_inputs) { inFileNames[ifnIdx++] = argument; continue; } in main()
688 /* First non-option arg is input_filename. */ in main()
689 if (!input_filename) { input_filename = argument; continue; } in main()
691 /* Second non-option arg is output_filename */ in main()
695 continue; in main()
698 /* 3rd+ non-option arg should not exist */ in main()
699 DISPLAYLEVEL(1, "%s : %s won't be used ! Do you want multiple input files (-m) ? \n", in main()
700 forceOverwrite ? "Warning" : "Error", in main()
779 … if (mode == om_auto) { /* auto-determine compression or decompression, based on file extension */ in main()
800 …while ((outl >= inl-4) && (input_filename[outl] == extension[outl-inl+4])) dynNameSpace[outl--]=0; in main()
801 …if (outl != inl-5) { DISPLAYLEVEL(1, "Cannot determine an output filename \n"); badusage(exeName);… in main()
816 /* Check if output is defined as console; trigger an error in this case */ in main()
821 DISPLAYLEVEL(1, "refusing to write to console without -c \n"); in main()
828 /* Auto-determine compression or decompression, based on file extension */ in main()