From 2ff5ad97f3ceccd6309488ac94fd2f99a4ad2c68 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Fri, 21 Apr 2023 14:31:07 +0200 Subject: [PATCH] cli: Error out if we wrongly pass a `` It was previously possible to call `rad patch open` with a patch-id and get no error. This fixes it. --- radicle-cli/src/commands/patch.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/radicle-cli/src/commands/patch.rs b/radicle-cli/src/commands/patch.rs index b42742cc..73139186 100644 --- a/radicle-cli/src/commands/patch.rs +++ b/radicle-cli/src/commands/patch.rs @@ -202,7 +202,15 @@ impl Args for Options { unknown => anyhow::bail!("unknown operation '{}'", unknown), }, Value(val) - if op.is_some() && op != Some(OperationName::List) && patch_id.is_none() => + if patch_id.is_none() + && [ + Some(OperationName::Show), + Some(OperationName::Update), + Some(OperationName::Delete), + Some(OperationName::Archive), + Some(OperationName::Checkout), + ] + .contains(&op) => { let val = string(&val); patch_id = Some(Rev::from(val));