summaryrefslogtreecommitdiffstats
path: root/cli/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index 55279b1..48bbb1d 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -71,7 +71,7 @@ struct Mn {
fn main() {
let mut store = Store::open(PathBuf::from("store")).unwrap();
- let search = Search::new(store.transactions().iter().collect());
+ let search = Search::new(store.transactions());
let search = search.subtract(Constraint::Category("a".to_string()));
let args = Mn::from_args();
@@ -108,7 +108,9 @@ fn main() {
println!("{}", store.categories().join("\n"));
}
Command::Show => {
- println!("{}", Table::new(store.transactions()).with(Style::psql()));
+ let mut transactions = store.transactions();
+ transactions.sort_by(|t1, t2| t1.date.cmp(&t2.date));
+ println!("{}", Table::new(transactions).with(Style::psql()));
}
}
}