diff --git a/Cargo.toml b/Cargo.toml index feff33f..e465349 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,3 +12,8 @@ chrono = "0.4" chrono-tz = "0.4" clap = { version = "3.2.12", features = ["derive"] } regex = "1.6.0" + +[[bin]] +bench = false +path = "src/main.rs" +name = "tclock" diff --git a/README.md b/README.md new file mode 100644 index 0000000..34f6dbb --- /dev/null +++ b/README.md @@ -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. diff --git a/assets/demo-clock-mode.gif b/assets/demo-clock-mode.gif new file mode 100644 index 0000000..4a22382 Binary files /dev/null and b/assets/demo-clock-mode.gif differ diff --git a/assets/demo-stopwatch-mode.gif b/assets/demo-stopwatch-mode.gif new file mode 100644 index 0000000..c33a405 Binary files /dev/null and b/assets/demo-stopwatch-mode.gif differ diff --git a/assets/demo-timer-mode.gif b/assets/demo-timer-mode.gif new file mode 100644 index 0000000..28f1f57 Binary files /dev/null and b/assets/demo-timer-mode.gif differ diff --git a/src/app.rs b/src/app.rs index dad6b76..8dd588b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -27,7 +27,7 @@ pub(crate) enum Mode { } #[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 { #[clap(subcommand)] pub mode: Option,