2021-04-26 05:05:15 -06:00
|
|
|
use eyre::Result;
|
2021-04-26 04:50:31 -06:00
|
|
|
use structopt::StructOpt;
|
|
|
|
|
|
|
|
#[derive(StructOpt)]
|
|
|
|
pub enum Cmd {
|
|
|
|
#[structopt(about = "zsh setup")]
|
|
|
|
Zsh,
|
|
|
|
#[structopt(about = "bash setup")]
|
|
|
|
Bash,
|
|
|
|
}
|
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-04-26 04:50:31 -06:00
|
|
|
impl Cmd {
|
|
|
|
pub fn run(&self) -> Result<()> {
|
|
|
|
match self {
|
|
|
|
Self::Zsh => init_zsh(),
|
|
|
|
Self::Bash => init_bash(),
|
|
|
|
}
|
2021-02-15 16:33:30 -07:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|