diff options
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/ts/tskm/src/main.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pkgs/by-name/ts/tskm/src/main.rs b/pkgs/by-name/ts/tskm/src/main.rs index 7fc9c0d4..f4416c6d 100644 --- a/pkgs/by-name/ts/tskm/src/main.rs +++ b/pkgs/by-name/ts/tskm/src/main.rs @@ -1,14 +1,13 @@ -#![allow(clippy::missing_panics_doc)] -#![allow(clippy::missing_errors_doc)] - use anyhow::Result; use clap::Parser; +use state::State; use crate::interface::{input, neorg, open, project}; pub mod cli; pub mod interface; pub mod rofi; +pub mod state; pub mod task; use crate::cli::{CliArgs, Command}; @@ -47,18 +46,20 @@ fn main() -> Result<(), anyhow::Error> { stderrlog::new() .module(module_path!()) - .quiet(false) + .quiet(args.quiet) .show_module_names(true) .color(stderrlog::ColorChoice::Auto) - .verbosity(5) + .verbosity(usize::from(args.verbosity)) .timestamp(stderrlog::Timestamp::Off) .init() .expect("Let's just hope that this does not panic"); + let mut state = State::new_rw()?; + match args.command { Command::Inputs { command } => input::handle(command)?, - Command::Neorg { command } => neorg::handle(command)?, - Command::Open { command } => open::handle(command)?, + Command::Neorg { command } => neorg::handle(command, &mut state)?, + Command::Open { command } => open::handle(command, &mut state)?, Command::Projects { command } => project::handle(command)?, } |