From 8519dc4a10d47747e6df3f47e25c36bf16befe00 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 1 Mar 2024 14:49:48 +0000 Subject: feat(send): fix grammar in cli output refer to a single patch as patch rather than patches --- src/sub_commands/send.rs | 9 ++++++++- tests/send.rs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 6417870..2a6c220 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs @@ -178,12 +178,19 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { )?; println!( - "posting {} patches {} a covering letter...", + "posting {} patch{} {} a covering letter...", if cover_letter_title_description.is_none() { events.len() } else { events.len() - 1 }, + if cover_letter_title_description.is_none() && events.len().eq(&1) + || cover_letter_title_description.is_some() && events.len().eq(&2) + { + "es" + } else { + "" + }, if cover_letter_title_description.is_none() { "without" } else { diff --git a/tests/send.rs b/tests/send.rs index 2d02a7d..4e1adf4 100644 --- a/tests/send.rs +++ b/tests/send.rs @@ -1169,7 +1169,7 @@ mod when_on_main_branch_defaults_to_last_commit { p.expect("searching for profile and relay updates...\r\n")?; p.expect("\r")?; p.expect("logged in as fred\r\n")?; - p.expect("posting 1 patches without a covering letter...\r\n")?; + p.expect("posting 1 patch without a covering letter...\r\n")?; Ok(()) } async fn prep_run_create_proposal() -> Result<( -- cgit v1.2.3