mirror of
https://github.com/Drop-OSS/interactive-clap.git
synced 2026-07-01 11:13:51 -04:00
fix: Trim unnecessary spaces in inquire prompts (fix it again after recent refactoring that reverted the previous fix)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -61,7 +61,7 @@ pub fn vec_fn_input_arg(
|
||||
fn #fn_input_arg(
|
||||
_context: &#input_context_dir,
|
||||
) -> color_eyre::eyre::Result<Option<#ty>> {
|
||||
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()),
|
||||
|
||||
Reference in New Issue
Block a user