Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion programs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Compress or decompress the INPUT file(s); reads from STDIN if INPUT is `-` or no
Usage: zstd [OPTIONS...] [INPUT... | -] [-o OUTPUT]

Options:
-o OUTPUT Write output to a single file, OUTPUT.
-o, --output OUTPUT Write output to a single file, OUTPUT.
-k, --keep Preserve INPUT file(s). [Default]
--rm Remove INPUT file(s) after successful (de)compression to file.

Expand Down
6 changes: 3 additions & 3 deletions programs/zstd.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\fBzstd\fR \- zstd, zstdmt, unzstd, zstdcat \- Compress or decompress \.zst files
.
.SH "SYNOPSIS"
\fBzstd\fR [\fIOPTIONS\fR] [\-|\fIINPUT\-FILE\fR] [\-o \fIOUTPUT\-FILE\fR]
\fBzstd\fR [\fIOPTIONS\fR] [\-|\fIINPUT\-FILE\fR] [\-o|\-\-output \fIOUTPUT\-FILE\fR]
.
.P
\fBzstdmt\fR is equivalent to \fBzstd \-T0\fR
Expand Down Expand Up @@ -192,7 +192,7 @@ Additionally, this can be used to limit memory for dictionary training\. This pa
\fB\-c\fR, \fB\-\-stdout\fR: write to standard output (even if it is the console); keep original files (disable \fB\-\-rm\fR)\.
.
.IP "\(bu" 4
\fB\-o FILE\fR: save result into \fBFILE\fR\. Note that this operation is in conflict with \fB\-c\fR\. If both operations are present on the command line, the last expressed one wins\.
\fB\-o FILE\fR, \fB\-\-output FILE\fR: save result into \fBFILE\fR\. Note that this operation is in conflict with \fB\-c\fR\. If both operations are present on the command line, the last expressed one wins\.
.
.IP "\(bu" 4
\fB\-\-[no\-]sparse\fR: enable / disable sparse FS support, to make files with many zeroes smaller on disk\. Creating sparse files may save disk space and speed up decompression by reducing the amount of disk I/O\. default: enabled when output is into a file, and disabled when output is stdout\. This setting overrides default and can force sparse mode over stdout\.
Expand Down Expand Up @@ -434,7 +434,7 @@ Since dictionary compression is mostly effective for small files, the expectatio
\fB\-\-train\fR supports multithreading if \fBzstd\fR is compiled with threading support (default)\. Additional advanced parameters can be specified with \fB\-\-train\-fastcover\fR\. The legacy dictionary builder can be accessed with \fB\-\-train\-legacy\fR\. The slower cover dictionary builder can be accessed with \fB\-\-train\-cover\fR\. Default \fB\-\-train\fR is equivalent to \fB\-\-train\-fastcover=d=8,steps=4\fR\.
.
.TP
\fB\-o FILE\fR
\fB\-o FILE\fR, \fB\-\-output FILE\fR
Dictionary saved into \fBFILE\fR (default name: dictionary)\.
.
.TP
Expand Down
6 changes: 3 additions & 3 deletions programs/zstd.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ zstd(1) -- zstd, zstdmt, unzstd, zstdcat - Compress or decompress .zst files
SYNOPSIS
--------

`zstd` [<OPTIONS>] [-|<INPUT-FILE>] [-o <OUTPUT-FILE>]
`zstd` [<OPTIONS>] [-|<INPUT-FILE>] [-o|--output <OUTPUT-FILE>]

`zstdmt` is equivalent to `zstd -T0`

Expand Down Expand Up @@ -244,7 +244,7 @@ the last one takes effect.
unrecognized formats as-is.
* `-c`, `--stdout`:
write to standard output (even if it is the console); keep original files (disable `--rm`).
* `-o FILE`:
* `-o FILE`, `--output FILE`:
save result into `FILE`.
Note that this operation is in conflict with `-c`.
If both operations are present on the command line, the last expressed one wins.
Expand Down Expand Up @@ -544,7 +544,7 @@ Compression of small files similar to the sample set will be greatly improved.
The slower cover dictionary builder can be accessed with `--train-cover`.
Default `--train` is equivalent to `--train-fastcover=d=8,steps=4`.

* `-o FILE`:
* `-o FILE`, `--output FILE`:
Dictionary saved into `FILE` (default name: dictionary).
* `--maxdict=#`:
Limit dictionary to specified size (default: 112640 bytes).
Expand Down
4 changes: 3 additions & 1 deletion programs/zstdcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void usage(FILE* f, const char* programName)
DISPLAY_F(f, "Compress or decompress the INPUT file(s); reads from STDIN if INPUT is `-` or not provided.\n\n");
DISPLAY_F(f, "Usage: %s [OPTIONS...] [INPUT... | -] [-o OUTPUT]\n\n", programName);
DISPLAY_F(f, "Options:\n");
DISPLAY_F(f, " -o OUTPUT Write output to a single file, OUTPUT.\n");
DISPLAY_F(f, " -o, --output OUTPUT Write output to a single file, OUTPUT.\n");
DISPLAY_F(f, " -c, --stdout Write to STDOUT (even if it is a console) and keep the INPUT file(s).\n");
DISPLAY_F(f, " -k, --keep Preserve INPUT file(s). [Default] \n");
DISPLAY_F(f, " --rm Remove INPUT file(s) after successful (de)compression to file.\n");
Expand Down Expand Up @@ -1004,6 +1004,8 @@ int main(int argCount, const char* argv[])
if (!strcmp(argument, "--verbose")) { g_displayLevel++; continue; }
if (!strcmp(argument, "--quiet")) { g_displayLevel--; continue; }
if (!strcmp(argument, "--stdout")) { forceStdout=1; outFileName=stdoutmark; continue; }
if (!strcmp(argument, "--output")) { argument += 8; NEXT_FIELD(outFileName); continue; }
if (longCommandWArg(&argument, "--output=")) { outFileName = argument; continue; }
if (!strcmp(argument, "--ultra")) { ultra=1; continue; }
if (!strcmp(argument, "--check")) { FIO_setChecksumFlag(prefs, 2); continue; }
if (!strcmp(argument, "--no-check")) { FIO_setChecksumFlag(prefs, 0); continue; }
Expand Down
6 changes: 6 additions & 0 deletions tests/playTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ println "test : compress to named file (-o)"
rm -f tmpCompressed
zstd tmp -o tmpCompressed
test -f tmpCompressed # file must be created
rm -f tmpCompressed
zstd tmp --output tmpCompressed
test -f tmpCompressed # file must be created
rm -f tmpCompressed
zstd tmp --output=tmpCompressed
test -f tmpCompressed # file must be created

println "test : force write, correct order"
zstd tmp -fo tmpCompressed
Expand Down