add readme

This commit is contained in:
race604 2022-07-19 16:55:36 +08:00
parent 74c9543402
commit 1e5b5921c0
6 changed files with 62 additions and 1 deletions

View file

@ -12,3 +12,8 @@ chrono = "0.4"
chrono-tz = "0.4" chrono-tz = "0.4"
clap = { version = "3.2.12", features = ["derive"] } clap = { version = "3.2.12", features = ["derive"] }
regex = "1.6.0" regex = "1.6.0"
[[bin]]
bench = false
path = "src/main.rs"
name = "tclock"

56
README.md Normal file
View file

@ -0,0 +1,56 @@
# clock-tui
A clock app in terminal. It support the following modes:
## Clock
![clock](/assets/demo-clock-mode.gif)
## Timer
![timer](/assets/demo-timer-mode.gif)
## Stopwatch
![stopwatch](/assets/demo-stopwatch-mode.gif)
# Usage
## Help inforamtion
```shell
$ tclock --help
```
## Clock mode, this it the default mode
```shell
$ tclock clock
# Or just run
$ tclock
```
## Run timer
```shell
# Start timer for 5 minutes
$ tclock timer -d 5m
```
The option `-d` or `--duration` to set time, for example `100s`, `5m`, `1h`, etc.
You can press `Space` key to _pause_ and _resume_ the timer.
## Run stopwatch
```shell
# Start timer for 5 minutes
$ tclock stopwatch
```
You can press `Space` key to _pause_ and _resume_ the stopwatch.
# License
MIT License.

BIN
assets/demo-clock-mode.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
assets/demo-timer-mode.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View file

@ -27,7 +27,7 @@ pub(crate) enum Mode {
} }
#[derive(clap::Parser)] #[derive(clap::Parser)]
#[clap(about = "A clock app in terminal", long_about = None)] #[clap(name = "tclock", about = "A clock app in terminal", long_about = None)]
pub(crate) struct App { pub(crate) struct App {
#[clap(subcommand)] #[clap(subcommand)]
pub mode: Option<Mode>, pub mode: Option<Mode>,