toggl 0.1.2

Unofficial command-line interface for Toggl Track using the v9 API.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::api;
use crate::models;
use api::ApiClient;
use colored::Colorize;
use models::ResultWithDefaultError;

pub struct RunningTimeEntryCommand;

impl RunningTimeEntryCommand {
    pub async fn execute(api_client: impl ApiClient) -> ResultWithDefaultError<()> {
        match api_client.get_running_time_entry().await? {
            None => println!("{}", "No time entry is running at the moment".yellow()),
            Some(running_time_entry) => println!("{}", running_time_entry),
        }

        Ok(())
    }
}