diff --git a/crates/nu-protocol/src/syntax_shape.rs b/crates/nu-protocol/src/syntax_shape.rs index 85f308e105..87d491e40a 100644 --- a/crates/nu-protocol/src/syntax_shape.rs +++ b/crates/nu-protocol/src/syntax_shape.rs @@ -250,9 +250,14 @@ impl Display for SyntaxShape { SyntaxShape::Error => write!(f, "error"), SyntaxShape::CompleterWrapper(x, _) => write!(f, "completable<{x}>"), SyntaxShape::OneOf(list) => { - let arg_vec: Vec<_> = list.iter().map(|x| x.to_string()).collect(); - let arg_string = arg_vec.join(", "); - write!(f, "one_of({arg_string})") + write!(f, "(")?; + if let Some((last, rest)) = list.split_last() { + for ty in rest { + write!(f, "{ty} | ")?; + } + write!(f, "{last}")?; + } + write!(f, ")") } SyntaxShape::Nothing => write!(f, "nothing"), }