From d80edfc8424d2e0986f3d24a7f2dcb97d1531a63 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Tue, 30 May 2023 16:49:50 +0200 Subject: [PATCH] fix: Trim unnecessary spaces in inquire prompts (fix it again after recent refactoring that reverted the previous fix) --- .../src/derives/interactive_clap/methods/choose_variant.rs | 2 +- .../src/derives/interactive_clap/methods/input_arg.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interactive-clap-derive/src/derives/interactive_clap/methods/choose_variant.rs b/interactive-clap-derive/src/derives/interactive_clap/methods/choose_variant.rs index f04e0b0..4c9635f 100644 --- a/interactive-clap-derive/src/derives/interactive_clap/methods/choose_variant.rs +++ b/interactive-clap-derive/src/derives/interactive_clap/methods/choose_variant.rs @@ -85,7 +85,7 @@ pub fn fn_choose_variant( use strum::{EnumMessage, IntoEnumIterator}; let selected_variant = Select::new( - concat!(#( #doc_attrs, )*), + concat!(#( #doc_attrs, )*).trim(), #command_discriminants::iter() .map(SelectVariantOrBack::Variant) #actions_push_back diff --git a/interactive-clap-derive/src/derives/interactive_clap/methods/input_arg.rs b/interactive-clap-derive/src/derives/interactive_clap/methods/input_arg.rs index 77b06e8..8d82541 100644 --- a/interactive-clap-derive/src/derives/interactive_clap/methods/input_arg.rs +++ b/interactive-clap-derive/src/derives/interactive_clap/methods/input_arg.rs @@ -61,7 +61,7 @@ pub fn vec_fn_input_arg( fn #fn_input_arg( _context: &#input_context_dir, ) -> color_eyre::eyre::Result> { - match inquire::CustomType::new(concat!(#( #doc_attrs, )*)).prompt() { + match inquire::CustomType::new(concat!(#( #doc_attrs, )*).trim()).prompt() { Ok(value) => Ok(Some(value)), Err(inquire::error::InquireError::OperationCanceled | inquire::error::InquireError::OperationInterrupted) => Ok(None), Err(err) => Err(err.into()),