Add support for Alfred (#347)

This commit is contained in:
Denis Isidoro 2020-04-19 15:51:04 -03:00 committed by GitHub
parent 019adf82cf
commit c7f919eaa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 850 additions and 54 deletions

View file

@ -1,7 +1,7 @@
use crate::flows;
use crate::flows::core::Variant;
use crate::structures::option::Command::{Best, Fn, Preview, Query, Repo, Search, Widget};
use crate::structures::option::{Config, RepoCommand};
use crate::structures::option::Command::{Alfred, Best, Fn, Preview, Query, Repo, Search, Widget};
use crate::structures::option::{AlfredCommand, Config, RepoCommand};
use anyhow::Context;
use anyhow::Error;
@ -39,6 +39,12 @@ pub fn handle_config(config: Config) -> Result<(), Error> {
RepoCommand::Browse => flows::repo::browse(&config.finder)
.context("Failed to browse featured cheatsheets"),
},
Alfred { cmd } => match cmd {
AlfredCommand::Start => flows::alfred::main(config),
AlfredCommand::Suggestions => flows::alfred::suggestions(config),
AlfredCommand::Transform => flows::alfred::transform(config),
},
},
}
}