diff --git a/crates/ty/docs/cli.md b/crates/ty/docs/cli.md index efe141813e..8ffd58cc6d 100644 --- a/crates/ty/docs/cli.md +++ b/crates/ty/docs/cli.md @@ -84,7 +84,7 @@ over all configuration files.

  • 3.11
  • 3.12
  • 3.13
  • -
    --quiet

    Use quiet output

    +
    --quiet, -q

    Use quiet output

    --respect-ignore-files

    Respect file exclusions via .gitignore and other standard ignore files. Use --no-respect-gitignore to disable

    --typeshed, --custom-typeshed-dir path

    Custom directory to use for stdlib typeshed stubs

    --verbose, -v

    Use verbose output (or -vv and -vvv for more verbose output)

    diff --git a/crates/ty/src/logging.rs b/crates/ty/src/logging.rs index a85d527a47..a67511c7c9 100644 --- a/crates/ty/src/logging.rs +++ b/crates/ty/src/logging.rs @@ -30,6 +30,7 @@ pub(crate) struct Verbosity { #[arg( long, + short, help = "Use quiet output", action = clap::ArgAction::Count, global = true, diff --git a/crates/ty/tests/cli/main.rs b/crates/ty/tests/cli/main.rs index 14c237a729..67fb9b0122 100644 --- a/crates/ty/tests/cli/main.rs +++ b/crates/ty/tests/cli/main.rs @@ -69,6 +69,26 @@ fn test_quiet_output() -> anyhow::Result<()> { ----- stderr ----- "); + // We allow `-q` + assert_cmd_snapshot!(case.command().arg("-q"), @r" + success: false + exit_code: 1 + ----- stdout ----- + Found 1 diagnostic + + ----- stderr ----- + "); + + // And repeated `-qq` + assert_cmd_snapshot!(case.command().arg("-qq"), @r" + success: false + exit_code: 1 + ----- stdout ----- + Found 1 diagnostic + + ----- stderr ----- + "); + Ok(()) }