Skip to content

Commit

Permalink
feat: nr bin can fuzzy select
Browse files Browse the repository at this point in the history
  • Loading branch information
zhazhazhu committed Dec 28, 2023
1 parent 0f25698 commit d1aa4b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bin/nr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::process;

use console::style;
use dialoguer::{theme::ColorfulTheme, Select};
use dialoguer::FuzzySelect;
use npack::{
parse::parse_nr,
runner::run_cli,
Expand All @@ -21,6 +21,7 @@ impl ToString for ScriptRaw {
let key = self.key.clone();
let description = self.description.clone();
let item = format!("{} {}", style(key).cyan(), style(description).dim());
println!("selection option {}", item);
item
}
}
Expand Down Expand Up @@ -84,8 +85,8 @@ fn main() {
};
}

let select = Select::with_theme(&ColorfulTheme::default())
.with_prompt("script to run")
let select = FuzzySelect::new()
.with_prompt("script to run:")
.default(0)
.items(&raw)
.interact()
Expand Down

0 comments on commit d1aa4b8

Please sign in to comment.