atuin/src/command/init.rs
Jannik 446ffb88c7
Resolve clippy warnings (#187)
* refactor: nest or patterns

* refactor: fix clippy lint names

* refactor: remove unnecessary wraps

* style: apply cargo fmt
2021-09-24 16:03:37 +00:00

28 lines
506 B
Rust

use structopt::StructOpt;
#[derive(StructOpt)]
pub enum Cmd {
#[structopt(about = "zsh setup")]
Zsh,
#[structopt(about = "bash setup")]
Bash,
}
fn init_zsh() {
let full = include_str!("../shell/atuin.zsh");
println!("{}", full);
}
fn init_bash() {
let full = include_str!("../shell/atuin.bash");
println!("{}", full);
}
impl Cmd {
pub fn run(&self) {
match self {
Self::Zsh => init_zsh(),
Self::Bash => init_bash(),
}
}
}