2022-04-06 23:32:11 -06:00
|
|
|
use clap::Parser;
|
2021-04-26 04:50:31 -06:00
|
|
|
|
2022-04-06 23:32:11 -06:00
|
|
|
#[derive(Parser)]
|
2021-04-26 04:50:31 -06:00
|
|
|
pub enum Cmd {
|
2022-04-06 23:32:11 -06:00
|
|
|
/// Zsh setup
|
2021-04-26 04:50:31 -06:00
|
|
|
Zsh,
|
2022-04-06 23:32:11 -06:00
|
|
|
/// Bash setup
|
2021-04-26 04:50:31 -06:00
|
|
|
Bash,
|
2022-04-06 23:32:11 -06:00
|
|
|
/// Fish setup
|
2021-12-11 02:48:53 -07:00
|
|
|
Fish,
|
2021-04-26 04:50:31 -06:00
|
|
|
}
|
2021-02-15 16:33:30 -07:00
|
|
|
|
|
|
|
fn init_zsh() {
|
|
|
|
let full = include_str!("../shell/atuin.zsh");
|
|
|
|
println!("{}", full);
|
|
|
|
}
|
|
|
|
|
2021-04-26 04:50:31 -06:00
|
|
|
fn init_bash() {
|
|
|
|
let full = include_str!("../shell/atuin.bash");
|
|
|
|
println!("{}", full);
|
|
|
|
}
|
2021-02-15 16:33:30 -07:00
|
|
|
|
2021-12-11 02:48:53 -07:00
|
|
|
fn init_fish() {
|
|
|
|
let full = include_str!("../shell/atuin.fish");
|
|
|
|
println!("{}", full);
|
|
|
|
}
|
|
|
|
|
2021-04-26 04:50:31 -06:00
|
|
|
impl Cmd {
|
2021-09-24 10:03:37 -06:00
|
|
|
pub fn run(&self) {
|
2021-04-26 04:50:31 -06:00
|
|
|
match self {
|
|
|
|
Self::Zsh => init_zsh(),
|
|
|
|
Self::Bash => init_bash(),
|
2021-12-11 02:48:53 -07:00
|
|
|
Self::Fish => init_fish(),
|
2021-04-26 04:50:31 -06:00
|
|
|
}
|
2021-02-15 16:33:30 -07:00
|
|
|
}
|
|
|
|
}
|