update README for countdown mode

This commit is contained in:
race604 2022-08-31 21:56:04 +08:00
parent f3e58a635d
commit 9ef4575931
3 changed files with 27 additions and 2 deletions

View file

@ -14,6 +14,10 @@ A clock app in terminal. It support the following modes:
![stopwatch](/assets/demo-stopwatch-mode.gif) ![stopwatch](/assets/demo-stopwatch-mode.gif)
## Countdown
![countdown](/assets/demo-countdown-mode.gif)
# Usage # Usage
## Install ## Install
@ -31,8 +35,13 @@ $ tclock
``` ```
Run this command to start a clock, and press `q` to exit. Run this command to start a clock, and press `q` to exit.
You can always use `-h` or `--help` to show help message, for exmaple
```shell ```shell
$ tclock --help $ tclock --help
# or
$ tclock clock -h
``` ```
## Clock mode, this it the default mode ## Clock mode, this it the default mode
@ -44,6 +53,8 @@ $ tclock clock
$ tclock $ tclock
``` ```
For more details, run `tclock clock -h` to show usage.
## Run timer ## Run timer
```shell ```shell
@ -63,13 +74,27 @@ tclock timer -d 25m -e terminal-notifier -title tclock -message "'Time is up!'"
Here we use [terminal-notifier](https://github.com/julienXX/terminal-notifier) to fire a notification when time is up. Here we use [terminal-notifier](https://github.com/julienXX/terminal-notifier) to fire a notification when time is up.
For more details, run `tclock timer -h` to show usage.
## Run stopwatch ## Run stopwatch
```shell ```shell
$ tclock stopwatch $ tclock stopwatch
``` ```
You can press `Space` key to _pause_ and _resume_ the stopwatch. For more details, run `tclock stopwatch -h` to show usage.
## Run countdown
```shell
$ tclock countdown --time 2023-01-01 --title 'New Year 2023'`
```
You can use `-t` or `--time` to specify time, for example: `2023-01-01`, `20:00`, `'2022-12-25 20:00:00'` or `2022-12-25T20:00:00-04:00`.
You can use `-r` or `--reverse` to run in count-up mode, it counts up duration since the specific time.
For more details, run `tclock countdown -h` to show usage.
## Customize style ## Customize style

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -57,7 +57,7 @@ pub(crate) enum Mode {
Stopwatch, Stopwatch,
/// The countdown timer mode shows the duration to a specific time /// The countdown timer mode shows the duration to a specific time
Countdown { Countdown {
/// The target time to countdown to, eg. "2023-01-01", or "20:00" /// The target time to countdown to, eg. "2023-01-01", "20:00", "2022-12-25 20:00:00" or "2022-12-25T20:00:00-04:00"
#[clap(long, short, value_parser = parse_datetime)] #[clap(long, short, value_parser = parse_datetime)]
time: DateTime<Local>, time: DateTime<Local>,