Coverage Report

Created: 2024-02-20 21:15

/builds/xfbs/cindy/src/command.rs
Line
Count
Source (jump to first uncovered line)
1
use crate::{cli::Command, Cindy};
2
use anyhow::Result;
3
use std::time::Duration;
4
pub const UPDATE_INTERVAL: Duration = Duration::from_millis(30);
5
6
mod add;
7
mod query;
8
#[cfg(feature = "server")]
9
mod serve;
10
mod tags;
11
12
impl Cindy {
13
    // TODO: use global options (for thread count)
14
16
    pub async fn command(&self, command: &Command) -> Result<()> {
15
16
        match command {
16
1
            Command::Init(_) => Ok(()),
17
106
            Command::Add(
command) => self.command_add(command)12
.await,
18
1
            Command::Query(command) => self.command_query(command).await,
19
2
            Command::Tags(command) => self.command_tags(command).await,
20
            #[cfg(feature = "server")]
21
0
            Command::Serve(command) => self.command_serve(command).await,
22
0
            _ => Ok(()),
23
        }
24
16
    }
25
}