use cloud_terrastodon_user_input::Choice;
use cloud_terrastodon_user_input::PickerTui;
pub fn main() -> eyre::Result<()> {
let mut choices = Vec::new();
let dir = std::fs::read_dir(".")?;
for entry in dir {
let entry = entry?;
choices.push(entry);
}
let chosen = PickerTui::new()
.set_header("Pick a path")
.pick_one(choices.into_iter().map(|entry| Choice {
key: entry.path().display().to_string(), value: entry, }))?;
println!("You chose {}", chosen.file_name().to_string_lossy());
Ok(())
}