aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 798f7a23e3e96754b6b091a01f56e2ee78f5640c (plain) (blame)
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
31
32
#![warn(clippy::pedantic, clippy::nursery)]
#![allow(clippy::use_self, clippy::missing_const_for_fn)] // not 100% reliable

use clap::{AppSettings, Parser};
use eyre::Result;

use command::AtuinCmd;
mod command;

const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Magical shell history
#[derive(Parser)]
#[clap(
    author = "Ellie Huxtable <e@elm.sh>",
    version = VERSION,
    global_setting(AppSettings::DeriveDisplayOrder),
)]
struct Atuin {
    #[clap(subcommand)]
    atuin: AtuinCmd,
}

impl Atuin {
    fn run(self) -> Result<()> {
        self.atuin.run()
    }
}

fn main() -> Result<()> {
    Atuin::parse().run()
}