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.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index 606d3c1..a760401 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -35,6 +35,8 @@ struct Mn {
// mn insert expense --account Kortkonto --category a --category b
fn main() {
+ let mut store = model::Store::open(PathBuf::from("store")).unwrap();
+ println!("{:?}", store);
match Mn::from_args().command {
Command::Insert {
kind,
@@ -43,19 +45,17 @@ fn main() {
amount,
description,
} => {
- let post = model::Post::new(model::Transaction {
+ let transaction = model::Transaction {
kind,
to: account,
from: "Default".to_string(),
category,
amount,
description
- });
- println!("{:?}", post);
+ };
+ println!("{:?}", transaction);
+ store.push(transaction);
+ store.write().unwrap();
}
}
- // post.write(&"test").unwrap();
- // let store = model::Store::open(PathBuf::from("store")).unwrap();
- // println!("{:#?}", store);
- // store.write().unwrap();
}