atuin/src/main.rs

44 lines
746 B
Rust
Raw Normal View History

2021-02-14 08:15:26 -07:00
#![warn(clippy::pedantic, clippy::nursery)]
#![allow(clippy::use_self, clippy::missing_const_for_fn)] // not 100% reliable
2021-02-14 06:28:01 -07:00
2022-10-18 02:50:22 -06:00
use clap::Parser;
use eyre::Result;
2021-02-14 10:18:02 -07:00
use command::AtuinCmd;
2021-02-13 12:37:00 -07:00
mod command;
mod tui;
2021-02-13 12:37:00 -07:00
const VERSION: &str = env!("CARGO_PKG_VERSION");
2022-10-18 02:50:22 -06:00
static HELP_TEMPLATE: &str = "\
{before-help}{name} {version}
{author}
{about}
{usage-heading}
{usage}
{all-args}{after-help}";
2022-04-06 23:32:11 -06:00
/// Magical shell history
#[derive(Parser)]
2022-10-18 02:50:22 -06:00
#[command(
author = "Ellie Huxtable <e@elm.sh>",
version = VERSION,
2022-10-18 02:50:22 -06:00
help_template(HELP_TEMPLATE),
)]
2021-02-13 05:58:40 -07:00
struct Atuin {
2022-10-18 02:50:22 -06:00
#[command(subcommand)]
2021-02-13 05:58:40 -07:00
atuin: AtuinCmd,
}
2021-02-13 05:58:40 -07:00
impl Atuin {
fn run(self) -> Result<()> {
self.atuin.run()
}
}
fn main() -> Result<()> {
Atuin::parse().run()
}