mirror of
https://github.com/facebook/zstd.git
synced 2025-08-05 19:15:58 +03:00
When reading from stdin, write to stdout by default
This commit is contained in:
@@ -146,11 +146,8 @@ bool Options::parse(int argc, const char** argv) {
|
|||||||
// Determine output file if not specified
|
// Determine output file if not specified
|
||||||
if (outputFile.empty()) {
|
if (outputFile.empty()) {
|
||||||
if (inputFile == "-") {
|
if (inputFile == "-") {
|
||||||
std::fprintf(
|
outputFile = "-";
|
||||||
stderr,
|
} else {
|
||||||
"Invalid arguments: Reading from stdin, but -o not provided.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Attempt to add/remove zstd extension from the input file
|
// Attempt to add/remove zstd extension from the input file
|
||||||
if (decompress) {
|
if (decompress) {
|
||||||
int stemSize = inputFile.size() - zstdExtension.size();
|
int stemSize = inputFile.size() - zstdExtension.size();
|
||||||
@@ -165,6 +162,7 @@ bool Options::parse(int argc, const char** argv) {
|
|||||||
outputFile = inputFile + zstdExtension;
|
outputFile = inputFile + zstdExtension;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Check compression level
|
// Check compression level
|
||||||
{
|
{
|
||||||
unsigned maxCLevel = ultra ? ZSTD_maxCLevel() : maxNonUltraCompressionLevel;
|
unsigned maxCLevel = ultra ? ZSTD_maxCLevel() : maxNonUltraCompressionLevel;
|
||||||
|
Reference in New Issue
Block a user