summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-01-10 08:22:52 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-01-10 08:22:52 -0500
commita8b648b61abd318cba28c5a0326b75bc7dc2c0f3 (patch)
treeceecd97272f50f9ba9b36714af80443868f3f9e4
parentc30a74571b52703a2623b37833bdbe0e734f9ef9 (diff)
Pipe log view through less
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs3
2 files changed, 5 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index ee7d19d..1cd4414 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,8 +7,10 @@ edition = "2021"
[dependencies]
clap = { version = "4.0.32", features = ["derive"] }
+colored = "2.0.0"
git2 = "0.15.0"
nom = "7.1.2"
+pager = "0.16.1"
serde = "1.0.152"
serde_derive = "1.0.152"
toml = "0.5.10"
diff --git a/src/main.rs b/src/main.rs
index 5f00577..81efe21 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,6 +6,7 @@ use std::error::Error;
use std::process::Command;
use clap::{Parser, Subcommand};
use nom::number::complete::float;
+use pager::Pager;
use serde_derive::{Serialize, Deserialize};
use toml;
@@ -230,6 +231,8 @@ fn log_with_results(repo: &git2::Repository,
}
fn list_tests(repo: &git2::Repository, head: &Option<String>) {
+ Pager::with_pager("less -FRX").setup();
+
let results = results_read(RESULTS).unwrap();
let log = log_with_results(repo, head, &results).unwrap();