2021-06-18 11:27:19 -05:00
|
|
|
use std::convert::TryFrom;
|
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
use clap::ArgMatches;
|
2021-07-16 12:45:27 -05:00
|
|
|
use chrono::{DateTime, Utc};
|
2021-06-18 11:27:19 -05:00
|
|
|
|
2021-07-07 07:19:55 -05:00
|
|
|
use crate::error::Result;
|
|
|
|
use crate::database::Database;
|
2021-06-21 17:38:51 -05:00
|
|
|
use crate::config::Config;
|
2021-06-18 11:27:19 -05:00
|
|
|
|
|
|
|
pub mod r#in;
|
|
|
|
pub mod display;
|
2021-07-06 22:52:20 -05:00
|
|
|
pub mod today;
|
2021-07-07 11:58:13 -05:00
|
|
|
pub mod yesterday;
|
2021-07-01 23:44:38 -05:00
|
|
|
pub mod sheet;
|
2021-07-07 13:44:19 -05:00
|
|
|
pub mod week;
|
2021-07-07 13:52:40 -05:00
|
|
|
pub mod month;
|
2021-07-14 12:37:45 -05:00
|
|
|
pub mod list;
|
2021-07-20 10:08:04 -05:00
|
|
|
pub mod out;
|
2021-07-26 16:55:24 -05:00
|
|
|
pub mod resume;
|
2021-07-26 20:07:11 -05:00
|
|
|
pub mod backend;
|
2021-07-30 17:55:19 -05:00
|
|
|
pub mod kill;
|
2021-08-02 18:45:54 -05:00
|
|
|
pub mod now;
|
2021-06-18 11:27:19 -05:00
|
|
|
|
|
|
|
pub trait Command<'a> {
|
|
|
|
type Args: TryFrom<&'a ArgMatches<'a>>;
|
|
|
|
|
2021-07-16 12:45:27 -05:00
|
|
|
fn handle<D: Database, O: Write, E: Write>(args: Self::Args, db: &mut D, out: &mut O, err: &mut E, config: &Config, now: DateTime<Utc>) -> Result<()>;
|
2021-07-06 22:52:20 -05:00
|
|
|
}
|