aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2024-07-09 11:43:29 -0500
committerjvech <jmvalenciae@unal.edu.co>2024-07-09 11:43:29 -0500
commit18d46f7a8550fd0773df6ca838a0caf6f4b657c4 (patch)
tree2d93cb2740450d5c7101359184b745329c83d695 /src/main.rs
parent5c9abec6cb729365439a7f783d63dfc32eeb2955 (diff)
add: note filter implemented
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 8a4f338..c4acc8b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,5 @@
use xdg;
-use rusqlite::Result;
+use rusqlite::{Result, Connection};
mod database;
mod cli;
@@ -27,13 +27,14 @@ fn main() -> Result<()> {
register.add_register(&datapath)?;
},
- Commands::View {history, filter, total} => {
+ Commands::View {agent, filter_note, history, total} => {
let datapath = cli.database_path.expect("database path not found");
+ let conn = Connection::open(&datapath)?;
match (history, total) {
- (true, false) => Database::view_history(&datapath, filter)?,
- (false, true) => Database::view_total(&datapath)?,
- (false, false) => Database::view_total(&datapath)?,
+ (true, false) => Database::view_history(conn, agent, filter_note)?,
+ (false, true) => Database::view_total(conn)?,
+ (false, false) => Database::view_total(conn)?,
(true, true) => unreachable!()
}
},
Feel free to download, copy and edit any repo