atuin/src/main.rs

37 lines
673 B
Rust
Raw Normal View History

2021-02-14 08:15:26 -07:00
#![warn(clippy::pedantic, clippy::nursery)]
2021-03-10 14:24:08 -07:00
#![allow(clippy::use_self)] // not 100% reliable
2021-02-14 06:28:01 -07:00
use clap::{AppSettings, Parser};
use eyre::Result;
#[macro_use]
extern crate log;
2021-02-14 10:18:02 -07:00
use command::AtuinCmd;
2021-02-13 12:37:00 -07:00
mod command;
const VERSION: &str = env!("CARGO_PKG_VERSION");
2022-04-06 23:32:11 -06:00
/// Magical shell history
#[derive(Parser)]
#[clap(
author = "Ellie Huxtable <e@elm.sh>",
version = VERSION,
2022-04-06 23:32:11 -06:00
global_setting(AppSettings::DeriveDisplayOrder),
)]
2021-02-13 05:58:40 -07:00
struct Atuin {
2022-04-06 23:32:11 -06:00
#[clap(subcommand)]
2021-02-13 05:58:40 -07:00
atuin: AtuinCmd,
}
2021-02-13 05:58:40 -07:00
impl Atuin {
async fn run(self) -> Result<()> {
self.atuin.run().await
}
}
#[tokio::main]
async fn main() -> Result<()> {
2022-04-06 23:32:11 -06:00
Atuin::parse().run().await
}