lz4/programs
Yann Collet b2215f2a89 tried to clean another bunch of cppcheck warnings
so "funny" thing with cppcheck
is that no 2 versions give the same list of warnings.

On Mac, I'm using v1.81, which had all warnings fixed.
On Travis CI, it's v1.61, and it complains about a dozen more/different things.
On Linux, it's v1.72, and it finds a completely different list of a half dozen warnings.

Some of these seems to be bugs/limitations in cppcheck itself.
The TravisCI version v1.61 seems unable to understand %zu correctly, and seems to assume it means %u.
2018-09-19 12:12:49 -07:00
..
.gitignore fix #284, reported by @beiDei8z : added test cases for path/to/lz4cat 2016-12-07 14:49:04 -08:00
bench.c fixed #560 2018-09-04 18:21:40 -07:00
bench.h bench: introduced hidden command -S 2018-03-19 17:19:25 -07:00
COPYING Makefile : added capability to install libraries 2014-01-07 18:47:50 +00:00
datagen.c programs/datagen : attempt to please static analyzer 2018-01-13 22:24:32 -08:00
datagen.h added a few dates 2016-11-21 15:51:39 -08:00
lz4.1 updated documentation regarding dictionary compression 2018-09-05 14:05:08 -07:00
lz4.1.md updated documentation regarding dictionary compression 2018-09-05 14:05:08 -07:00
lz4cli.c fixed minor cppcheck warnings in programs 2018-09-18 16:08:17 -07:00
lz4io.c tried to clean another bunch of cppcheck warnings 2018-09-19 12:12:49 -07:00
lz4io.h fasterDecSpeed can be triggered from cli with --favor-decSpeed 2018-04-26 15:49:32 -07:00
Makefile Add support for MidnightBSD 2018-09-08 14:46:54 -04:00
platform.h Add support for MidnightBSD 2018-09-08 14:46:54 -04:00
README.md updated programs\README.md 2016-11-16 10:53:06 +01:00
util.h fixed minor cppcheck warnings in programs 2018-09-18 16:08:17 -07:00

Command Line Interface for LZ4 library

Command Line Interface (CLI) can be created using the make command without any additional parameters. There are also multiple targets that create different variations of CLI:

  • lz4 : default CLI, with a command line syntax close to gzip
  • lz4c : Same as lz4 with additional support legacy lz4 commands (incompatible with gzip)
  • lz4c32 : Same as lz4c, but forced to compile in 32-bits mode

Aggregation of parameters

CLI supports aggregation of parameters i.e. -b1, -e18, and -i1 can be joined into -b1e18i1.

Benchmark in Command Line Interface

CLI includes in-memory compression benchmark module for lz4. The benchmark is conducted using a given filename. The file is read into memory. It makes benchmark more precise as it eliminates I/O overhead.

The benchmark measures ratio, compressed size, compression and decompression speed. One can select compression levels starting from -b and ending with -e. The -i parameter selects a number of seconds used for each of tested levels.

Usage of Command Line Interface

The full list of commands can be obtained with -h or -H parameter:

Usage :
      lz4 [arg] [input] [output]

input   : a filename
          with no FILE, or when FILE is - or stdin, read standard input
Arguments :
 -1     : Fast compression (default)
 -9     : High compression
 -d     : decompression (default for .lz4 extension)
 -z     : force compression
 -f     : overwrite output without prompting
--rm    : remove source file(s) after successful de/compression
 -h/-H  : display help/long help and exit

Advanced arguments :
 -V     : display Version number and exit
 -v     : verbose mode
 -q     : suppress warnings; specify twice to suppress errors too
 -c     : force write to standard output, even if it is the console
 -t     : test compressed file integrity
 -m     : multiple input files (implies automatic output filenames)
 -r     : operate recursively on directories (sets also -m)
 -l     : compress using Legacy format (Linux kernel compression)
 -B#    : Block size [4-7] (default : 7)
 -BD    : Block dependency (improve compression ratio)
--no-frame-crc : disable stream checksum (default:enabled)
--content-size : compressed frame includes original size (default:not present)
--[no-]sparse  : sparse mode (default:enabled on file, disabled on stdout)
Benchmark arguments :
 -b#    : benchmark file(s), using # compression level (default : 1)
 -e#    : test all compression levels from -bX to # (default : 1)
 -i#    : minimum evaluation time in seconds (default : 3s)
 -B#    : cut file into independent blocks of size # bytes [32+]
                      or predefined block size [4-7] (default: 7)

License

All files in this directory are licensed under GPL-v2. See COPYING for details. The text of the license is also included at the top of each source file.