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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#![forbid(unsafe_code)]
#![warn(clippy::pedantic, clippy::nursery, clippy::allow_attributes)]
#![expect(
clippy::missing_const_for_fn, // not 100% reliable
clippy::redundant_pub_crate,
)]
#![expect(
clippy::cast_possible_wrap,
clippy::cast_sign_loss,
clippy::cast_possible_truncation,
reason = "We should remove all of these. But it's just a lot of work in this code-base"
)]
use clap::Parser;
use clap::builder::Styles;
use clap::builder::styling::{AnsiColor, Effects};
use eyre::Result;
use command::AtuinCmd;
mod command;
pub(crate) mod atuin_client;
pub(crate) mod atuin_common;
pub(crate) mod atuin_daemon;
pub(crate) mod atuin_history;
pub(crate) mod atuin_pty_proxy;
pub(crate) mod atuin_server;
mod print_error;
mod sync;
const VERSION: &str = env!("CARGO_PKG_VERSION");
const SHA: &str = env!("GIT_HASH");
const LONG_VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", env!("GIT_HASH"), ")");
static HELP_TEMPLATE: &str = "\
{before-help}{name} {version}
{author}
{about}
{usage-heading}
{usage}
{all-args}{after-help}";
const STYLES: Styles = Styles::styled()
.header(AnsiColor::Yellow.on_default().effects(Effects::BOLD))
.usage(AnsiColor::Green.on_default().effects(Effects::BOLD))
.literal(AnsiColor::Green.on_default().effects(Effects::BOLD))
.placeholder(AnsiColor::Green.on_default());
/// Magical shell history
#[derive(Parser)]
#[command(
author = "Ellie Huxtable <ellie@atuin.sh>",
version = VERSION,
long_version = LONG_VERSION,
help_template(HELP_TEMPLATE),
styles = STYLES,
)]
struct Atuin {
#[command(subcommand)]
atuin: AtuinCmd,
}
impl Atuin {
fn run(self) -> Result<()> {
self.atuin.run()
}
}
fn main() -> Result<()> {
Atuin::parse().run()
}
|