From 1be452744a7bc3b94a261162c67b85094fb9a98b Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:26:49 +0200 Subject: [PATCH] cli: Use leading dashes in channel designators (#10858) /cc @maxbrunsfeld Release Notes: - N/A --- crates/cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 80c892583f..1f4568e0f9 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -55,11 +55,11 @@ struct InfoPlist { fn main() -> Result<()> { // Intercept version designators #[cfg(target_os = "macos")] - if let Some(channel) = std::env::args().nth(1) { + if let Some(channel) = std::env::args().nth(1).filter(|arg| arg.starts_with("--")) { // When the first argument is a name of a release channel, we're gonna spawn off a cli of that version, with trailing args passed along. use std::str::FromStr as _; - if let Ok(channel) = release_channel::ReleaseChannel::from_str(&channel) { + if let Ok(channel) = release_channel::ReleaseChannel::from_str(&channel[2..]) { return mac_os::spawn_channel_cli(channel, std::env::args().skip(2).collect()); } }