diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
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!() } }, |