clock_cli/
lib.rs

1// Copyright (C) 2020 Tianyi Shi
2//
3// This file is part of clock-cli-rs.
4//
5// clock-cli-rs is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// clock-cli-rs is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with clock-cli-rs.  If not, see <http://www.gnu.org/licenses/>.
17
18//! # clock-cli-rs
19//!
20//! Command line clock utilities, with TUI interfaces, implemented in Rust. Currently, these features are implemented:
21//!
22//! - Stopwatch
23//!   - start/pause/stop: ✅
24//!   - lap time (similar to iOS's stopwatch's behaviour): ✅
25//!   - report of all pause/start/lap instances (moments): WIP
26//! - (Countdown) Timer
27//!   - basics: ✅
28//!
29//! # Installation
30//!
31//! If you are a Rustacean 🦀️, just `cargo install clock-cli`.
32//!
33//! Other installation methods: WIP
34//!
35//! # Usage
36//!
37//! ## Stopwatch:
38//!
39//! simply run:
40//!
41//! ```
42//! clock
43//! ```
44//!
45//! - Press `Space` to pause/resume.
46//! - Press `l` to lap.
47//! - Press `return` to finish.
48//!
49//! ## Countdown Timer:
50//!
51//! Specify the duration (in natual language) to run a countdown.
52//!
53//! Examples:
54//!
55//! ```
56//! clock 3 minutes
57//! clock 4h3m
58//! clock 1 day
59//! ```
60//!
61//! - Press `Space` to pause/resume.
62//! - Press `return` to cancel.
63//!
64//! # Compatibility
65//!
66//! Currently only works on Linux and MacOS.
67//!
68//! # Acknowledgement
69//!
70//! The TUI is based on the [**cursive**](https://github.com/gyscos/cursive) crate made by [Alexandre Bury (@glycos)](https://github.com/gyscos), who also helped me a lot during the development of this crate (see [glycose/cursive/#503](https://github.com/gyscos/cursive/pull/503))
71pub(crate) mod notify;
72pub mod tui;
73pub mod utils;