This commit is contained in:
Conrad Ludgate 2022-09-09 16:04:11 +01:00
parent 51cd420e7f
commit 0004a71350
No known key found for this signature in database
GPG Key ID: 197E3CACA1C980B5
3 changed files with 16 additions and 23 deletions

19
Cargo.lock generated
View File

@ -395,7 +395,9 @@ dependencies = [
"encode_unicode", "encode_unicode",
"libc", "libc",
"once_cell", "once_cell",
"regex",
"terminal_size", "terminal_size",
"unicode-width",
"winapi", "winapi",
] ]
@ -902,14 +904,13 @@ dependencies = [
[[package]] [[package]]
name = "indicatif" name = "indicatif"
version = "0.16.2" version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" checksum = "fcc42b206e70d86ec03285b123e65a5458c92027d1fb2ae3555878b8113b3ddf"
dependencies = [ dependencies = [
"console", "console",
"lazy_static",
"number_prefix", "number_prefix",
"regex", "unicode-width",
] ]
[[package]] [[package]]
@ -1533,13 +1534,11 @@ dependencies = [
[[package]] [[package]]
name = "rpassword" name = "rpassword"
version = "6.0.1" version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680"
dependencies = [ dependencies = [
"libc", "libc",
"serde",
"serde_json",
"winapi", "winapi",
] ]
@ -2211,9 +2210,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]] [[package]]
name = "tui" name = "tui"
version = "0.18.0" version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96fe69244ec2af261bced1d9046a6fee6c8c2a6b0228e59e5ba39bc8ba4ed729" checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cassowary", "cassowary",

View File

@ -2,7 +2,7 @@
name = "atuin" name = "atuin"
version = "0.10.0" version = "0.10.0"
authors = ["Ellie Huxtable <ellie@elliehuxtable.com>"] authors = ["Ellie Huxtable <ellie@elliehuxtable.com>"]
edition = "2018" edition = "2021"
rust-version = "1.59" rust-version = "1.59"
license = "MIT" license = "MIT"
description = "atuin - magical shell history" description = "atuin - magical shell history"
@ -53,10 +53,10 @@ pretty_env_logger = "0.4"
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }
eyre = "0.6" eyre = "0.6"
directories = "4" directories = "4"
indicatif = "0.16.2" indicatif = "0.17.0"
serde = { version = "1.0.137", features = ["derive"] } serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81" serde_json = "1.0.81"
tui = { version = "0.18", default-features = false, features = ["termion"] } tui = { version = "0.19", default-features = false, features = ["termion"] }
termion = "1.5" termion = "1.5"
unicode-width = "0.1" unicode-width = "0.1"
itertools = "0.10.3" itertools = "0.10.3"
@ -70,7 +70,7 @@ clap = { version = "3.1.18", features = ["derive"] }
clap_complete = "3.1.4" clap_complete = "3.1.4"
fs-err = "2.7" fs-err = "2.7"
whoami = "1.1.2" whoami = "1.1.2"
rpassword = "6.0" rpassword = "7.0"
[dependencies.tracing-subscriber] [dependencies.tracing-subscriber]
version = "0.3" version = "0.3"

View File

@ -1,10 +1,4 @@
use std::{ use std::{io::stdout, ops::ControlFlow, time::Duration};
convert::TryFrom,
env,
io::stdout,
ops::{ControlFlow, Sub},
time::Duration,
};
use chrono::Utc; use chrono::Utc;
use clap::Parser; use clap::Parser;
@ -36,7 +30,7 @@ use super::{
history::ListMode, history::ListMode,
}; };
const VERSION: &str = env!("CARGO_PKG_VERSION"); const VERSION: &str = std::env!("CARGO_PKG_VERSION");
#[derive(Parser)] #[derive(Parser)]
pub struct Cmd { pub struct Cmd {
@ -184,7 +178,7 @@ fn duration(h: &History) -> String {
} }
fn ago(h: &History) -> String { fn ago(h: &History) -> String {
let ago = chrono::Utc::now().sub(h.timestamp); let ago = chrono::Utc::now() - h.timestamp;
// Account for the chance that h.timestamp is "in the future" // Account for the chance that h.timestamp is "in the future"
// This would mean that "ago" is negative, and the unwrap here // This would mean that "ago" is negative, and the unwrap here