facebook / facebook/zstd

More verbosity without welcome message

未关闭
#4,565 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
27.9k
派生
2.6k
平均合并
1 天 3 小时
30 天内合并 PR
8

描述

When compressing from `stdin`, it would be nice with an option to see the progress without the `WELCOME_MESSAGE`.

Especially in scripts that invoke `zstd` many times.

Current behaviour:
```
ls -l |zstd -9 -v > ll.zst
*** Zstandard CLI (64-bit) v1.6.0, by Yann Collet ***
/*stdin*\ : 36.23% ( 1.17 KiB => 434 B, /*stdout*\)
```

Proposed:
```
ls -l |zstd -9 -v > ll.zst
/*stdin*\ : 36.23% ( 1.17 KiB => 434 B, /*stdout*\)
```

```
ls -l |zstd -9 > ll.zst
[shows nothing - both before and after change]
```

**Proposed simple solution:**
```diff
diff --git a/programs/zstdcli.c b/programs/zstdcli.c
index 01760ff8..86ea5a10 100644
--- a/programs/zstdcli.c
+++ b/programs/zstdcli.c
@@ -1335,7 +1335,7 @@ int main(int argCount, const char* argv[])
}

/* Welcome message (if verbose) */
- DISPLAYLEVEL(3, WELCOME_MESSAGE);
+ DISPLAYLEVEL(4, WELCOME_MESSAGE);

#ifdef ZSTD_MULTITHREAD
if ((operation==zom_decompress) && (setThreads_non1)) {
```
so that two or more `-v`'s are needed for the welcome message to be shown.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。