diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/prompt_input.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/prompt_input.rs b/src/utils/prompt_input.rs index e887b9f..26343a2 100644 --- a/src/utils/prompt_input.rs +++ b/src/utils/prompt_input.rs @@ -54,3 +54,21 @@ fn validate_integer(text: &str) -> Validation { Validation::Valid } } + +#[derive(Debug)] +pub struct SelectOption { + pub value: String, + pub description: String, +} + +impl SelectOption { + pub fn new(value: String, description: String) -> Self { + Self { value, description } + } +} + +impl std::fmt::Display for SelectOption { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{} ({})", self.value, self.description) + } +} |
