-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
enhancementNew feature or requestNew feature or request
Description
pub fn prompt_tags(_initial: &[String]) -> io::Result<Vec<String>> {
let res: String = cliclack::input("Enter tags (one per line):")
.multiline()
.validate_interactively(|s: &String| {
for (i, line) in s.lines().enumerate() {
if line.is_empty() {
return Err(format!("line {} is empty", i + 1));
}
if !line.is_ascii() {
return Err(format!("line {} contains non-ascii characters", i + 1));
}
}
// .initial_input(&initial.join("\n"))
Ok(())
})
.interact()?;
Ok(res.lines().map(|s| s.to_string()).collect())
}
example use case ^: would allow editing with input.
I imagine it would override placeholder and default_value if nonempty.
it's a nice to have on a project of mine so very low priority for me to fork and implement currently, but if it fits the theme of the project id be interested in bumping it up and submitting a pr.
fadeevab
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request