Helper function to display a purpose if available (for execute commands)
(purpose: Option<&String>, updates: &mut impl Write)
| 452 | |
| 453 | /// Helper function to display a purpose if available (for execute commands) |
| 454 | pub fn display_purpose(purpose: Option<&String>, updates: &mut impl Write) -> Result<()> { |
| 455 | if let Some(purpose) = purpose { |
| 456 | queue!( |
| 457 | updates, |
| 458 | style::Print(super::CONTINUATION_LINE), |
| 459 | style::Print("\n"), |
| 460 | style::Print(super::PURPOSE_ARROW), |
| 461 | StyledText::info_fg(), |
| 462 | style::Print("Purpose: "), |
| 463 | StyledText::reset(), |
| 464 | style::Print(purpose), |
| 465 | style::Print("\n"), |
| 466 | )?; |
| 467 | } |
| 468 | Ok(()) |
| 469 | } |
| 470 | |
| 471 | /// Helper function to format function results with consistent styling |
| 472 | /// |
no outgoing calls
no test coverage detected