Compare commits

..

No commits in common. "3749f7204800ef52f2babf6f74a2d55c604adf1b" and "5dbea005620c5e417f396ea89ad9d3e53cec97b3" have entirely different histories.

2 changed files with 9 additions and 19 deletions

View file

@ -552,7 +552,7 @@ async fn main() -> Result<()> {
.inspect_err(|e| warn!("Invalid Priority {arg}: {e}")).ok() .inspect_err(|e| warn!("Invalid Priority {arg}: {e}")).ok()
.map(|p: Prio| p * (if arg.len() < 2 { 10 } else { 1 }))); .map(|p: Prio| p * (if arg.len() < 2 { 10 } else { 1 })));
} }
} },
} }
} }
@ -649,23 +649,13 @@ async fn main() -> Result<()> {
let (first, remaining) = arg.split_at(1); let (first, remaining) = arg.split_at(1);
if first == "(" { if first == "(" {
let mut max = usize::MAX; let mut max = usize::MAX;
if remaining.len() > 0 { match remaining.parse::<usize>() {
match remaining.parse::<usize>() { Ok(number) => max = number,
Ok(number) => max = number, Err(e) => warn!("Unsure what to do with {:?}", e),
Err(e) => warn!("Ignoring extra {:?}: {}\nSyntax: ((INT", remaining, e),
}
} }
let (label, times) = tasks.times_tracked(); let (label, times) = tasks.times_tracked();
let vec = times.rev().take(max).collect_vec(); println!("{}\n{}", label.italic(),
println!("{}\n{}", times.rev().take(max).collect_vec().iter().rev().join("\n"));
if vec.is_empty() {
label
} else {
format!("{} {}",
if max == usize::MAX { "All".to_string() } else { format!("Latest {max} entries of") },
label)
},
vec.iter().rev().join("\n"));
} else if let Ok(key) = PublicKey::parse(arg) { // TODO also match name } else if let Ok(key) = PublicKey::parse(arg) { // TODO also match name
let (label, mut times) = tasks.times_tracked_for(&key); let (label, mut times) = tasks.times_tracked_for(&key);
println!("{}\n{}", label.italic(), println!("{}\n{}", label.italic(),

View file

@ -278,7 +278,7 @@ impl TasksRelay {
} }
} }
Some(id) => { Some(id) => {
// TODO show current recursive with pubkey // TODO consider pubkey
let ids = vec![id]; let ids = vec![id];
let history = let history =
self.history.iter().flat_map(|(key, set)| { self.history.iter().flat_map(|(key, set)| {