From e6277ddf110dbd061c32f92bed09206888fed8c4 Mon Sep 17 00:00:00 2001 From: Ngalim Siregar Date: Sun, 17 Aug 2025 20:16:46 +0700 Subject: [PATCH] remove: completion alias --- CHANGELOG.md | 5 +++++ crates/forge/src/lib.rs | 12 ------------ crates/forge/tests/e2e/completions.rs | 24 +----------------------- crates/sncast/src/main.rs | 12 ------------ crates/sncast/tests/e2e/completions.rs | 19 ------------------- 5 files changed, 6 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f18b801ae..b169d7ac60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A bug that caused `#[fuzzer]` attribute to fail when used with generic structs +#### Removed + +- The `sncast completion` command. Use `sncast completions` instead +- The `snforge completion` command. Use `snforge completions` instead + ## [0.48.0] - 2025-08-05 ### Forge diff --git a/crates/forge/src/lib.rs b/crates/forge/src/lib.rs index 81fb2004d2..1f5bab2591 100644 --- a/crates/forge/src/lib.rs +++ b/crates/forge/src/lib.rs @@ -109,8 +109,6 @@ enum ForgeSubcommand { /// Check if all `snforge` requirements are installed CheckRequirements, /// Generate completions script - // TODO(#3560): Remove the `completion` alias - #[command(alias = "completion")] Completions(Completions), } @@ -322,16 +320,6 @@ pub fn main_execution(ui: Arc) -> Result { ForgeSubcommand::Completions(completions) => { generate_completions(completions.shell, &mut Cli::command())?; - // TODO(#3560): Remove this warning when the `completion` alias is removed - if std::env::args().nth(1).as_deref() == Some("completion") { - let message = &WarningMessage::new( - "Command `snforge completion` is deprecated and will be removed in the future. Please use `snforge completions` instead.", - ); - - // `#` is required since `snforge completions` generates a script and the output is used directly - ui.println(&format!("# {}", message.text())); - } - Ok(ExitStatus::Success) } } diff --git a/crates/forge/tests/e2e/completions.rs b/crates/forge/tests/e2e/completions.rs index 38391fce3f..03206baa26 100644 --- a/crates/forge/tests/e2e/completions.rs +++ b/crates/forge/tests/e2e/completions.rs @@ -26,7 +26,7 @@ fn test_generate_completions_unsupported_shell() { std::env::set_var("SHELL", "/bin/unsupported"); } - let snapbox = Command::new(snforge_test_bin_path()).arg("completion"); + let snapbox = Command::new(snforge_test_bin_path()).arg("completions"); let output = snapbox.assert().failure(); @@ -39,25 +39,3 @@ fn test_generate_completions_unsupported_shell() { ), ); } - -#[test] -fn test_deprecated_alias() { - for variant in Shell::value_variants() { - let shell = variant.to_string(); - - let output = Command::new(snforge_test_bin_path()) - .arg("completion") - .arg(shell.as_str()) - .assert() - .success(); - - assert_stdout_contains( - output, - indoc!( - r" - # [WARNING] Command `snforge completion` is deprecated and will be removed in the future. Please use `snforge completions` instead. - " - ), - ); - } -} diff --git a/crates/sncast/src/main.rs b/crates/sncast/src/main.rs index 9cd2e63bd4..d720dd24e7 100644 --- a/crates/sncast/src/main.rs +++ b/crates/sncast/src/main.rs @@ -146,8 +146,6 @@ enum Commands { Verify(Verify), /// Generate completions script - // TODO(#3560): Remove the `completion` alias - #[command(alias = "completion")] Completions(Completions), /// Utility commands @@ -486,16 +484,6 @@ async fn run_async_command(cli: Cli, config: CastConfig, ui: &UI) -> Result<()> Commands::Completions(completions) => { generate_completions(completions.shell, &mut Cli::command())?; - // TODO(#3560): Remove this warning when the `completion` alias is removed - if std::env::args().nth(1).as_deref() == Some("completion") { - let message = &WarningMessage::new( - "Command `sncast completion` is deprecated and will be removed in the future. Please use `sncast completions` instead.", - ); - - // `#` is required since `sncast completion` generates a script and the output is used directly - ui.println(&format!("# {}", message.text())); - } - Ok(()) } diff --git a/crates/sncast/tests/e2e/completions.rs b/crates/sncast/tests/e2e/completions.rs index 3f05e35433..a7c7735109 100644 --- a/crates/sncast/tests/e2e/completions.rs +++ b/crates/sncast/tests/e2e/completions.rs @@ -39,22 +39,3 @@ fn test_generate_completions_unsupported_shell() { ), ); } - -#[test] -fn test_deprecated_alias() { - for variant in Shell::value_variants() { - let shell = variant.to_string(); - let args = vec!["completion", shell.as_str()]; - - let output = runner(&args).assert().success(); - - assert_stdout_contains( - output, - indoc!( - r" - # [WARNING] Command `sncast completion` is deprecated and will be removed in the future. Please use `sncast completions` instead. - " - ), - ); - } -}