summaryrefslogtreecommitdiffstats
path: root/cli/src/main.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-07-29 15:42:12 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-07-29 16:25:47 +0200
commit750ac56977cd08d850cf902c8c8070512ecf484f (patch)
treea8a13634c0bc2dfe653ab52410c7c1a2f4c18dd1 /cli/src/main.rs
parentcf79a3180282f08a6165f4b88f52b78a14b9c688 (diff)
downloadmoney-750ac56977cd08d850cf902c8c8070512ecf484f.tar.gz
table output and show command
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index 071e251..55279b1 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -3,6 +3,7 @@ use rust_decimal::Decimal;
use std::path::PathBuf;
use std::str::FromStr;
use structopt::StructOpt;
+use tabled::{Style, Table};
mod search;
mod store;
@@ -39,7 +40,8 @@ enum Command {
},
List {
target: ListTarget,
- }
+ },
+ Show,
}
#[derive(Debug)]
@@ -70,9 +72,7 @@ fn main() {
let mut store = Store::open(PathBuf::from("store")).unwrap();
let search = Search::new(store.transactions().iter().collect());
- println!("{:?}", search.get());
let search = search.subtract(Constraint::Category("a".to_string()));
- println!("{:?}", search.get());
let args = Mn::from_args();
eprintln!("{:?}", args);
@@ -107,5 +107,8 @@ fn main() {
} => {
println!("{}", store.categories().join("\n"));
}
+ Command::Show => {
+ println!("{}", Table::new(store.transactions()).with(Style::psql()));
+ }
}
}