Skip to content

Commit 0c84652

Browse files
authored
[ty] Allow -q short alias for --quiet (#19364)
1 parent 560ae04 commit 0c84652

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

crates/ty/docs/cli.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ty/src/logging.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub(crate) struct Verbosity {
3030

3131
#[arg(
3232
long,
33+
short,
3334
help = "Use quiet output",
3435
action = clap::ArgAction::Count,
3536
global = true,

crates/ty/tests/cli/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ fn test_quiet_output() -> anyhow::Result<()> {
6969
----- stderr -----
7070
");
7171

72+
// We allow `-q`
73+
assert_cmd_snapshot!(case.command().arg("-q"), @r"
74+
success: false
75+
exit_code: 1
76+
----- stdout -----
77+
Found 1 diagnostic
78+
79+
----- stderr -----
80+
");
81+
82+
// And repeated `-qq`
83+
assert_cmd_snapshot!(case.command().arg("-qq"), @r"
84+
success: false
85+
exit_code: 1
86+
----- stdout -----
87+
Found 1 diagnostic
88+
89+
----- stderr -----
90+
");
91+
7292
Ok(())
7393
}
7494

0 commit comments

Comments
 (0)