446ffb88c7
* refactor: nest or patterns * refactor: fix clippy lint names * refactor: remove unnecessary wraps * style: apply cargo fmt
28 lines
506 B
Rust
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(),
|
|
}
|
|
}
|
|
}
|