blob: d0f31f345b3b6b1781e12f573886ad3ad3490fdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
use eyre::Result;
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) -> Result<()> {
match self {
Self::Zsh => init_zsh(),
Self::Bash => init_bash(),
}
Ok(())
}
}
|