mirror of
https://github.com/denisidoro/navi.git
synced 2026-07-25 19:13:58 +00:00
Add support for Alfred (#347)
This commit is contained in:
parent
019adf82cf
commit
c7f919eaa0
19 changed files with 850 additions and 54 deletions
|
|
@ -3,7 +3,7 @@ use thiserror::Error;
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
#[error(
|
||||
"\rHey listen! Navi encountered a problem.
|
||||
"\rHey, listen! Navi encountered a problem.
|
||||
Do you think this is a bug? File an issue at https://github.com/denisidoro/navi."
|
||||
)]
|
||||
pub struct FileAnIssue {
|
||||
|
|
|
|||
5
src/structures/item.rs
Normal file
5
src/structures/item.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
pub struct Item<'a> {
|
||||
pub tags: &'a str,
|
||||
pub comment: &'a str,
|
||||
pub snippet: &'a str,
|
||||
}
|
||||
|
|
@ -2,4 +2,5 @@ pub mod cheat;
|
|||
pub mod error;
|
||||
pub mod finder;
|
||||
pub mod fnv;
|
||||
pub mod item;
|
||||
pub mod option;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,11 @@ pub enum Command {
|
|||
/// bash, zsh or fish
|
||||
shell: String,
|
||||
},
|
||||
/// Alfred
|
||||
Alfred {
|
||||
#[structopt(subcommand)]
|
||||
cmd: AlfredCommand,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
|
|
@ -119,6 +124,16 @@ pub enum RepoCommand {
|
|||
Browse,
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub enum AlfredCommand {
|
||||
/// Start
|
||||
Start,
|
||||
/// Suggestions
|
||||
Suggestions,
|
||||
/// Transform
|
||||
Transform,
|
||||
}
|
||||
|
||||
pub fn config_from_env() -> Config {
|
||||
Config::from_args()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue