From 08fb4d0328a98292dbdae8a34ff92bca9358599d Mon Sep 17 00:00:00 2001 From: race604 Date: Wed, 20 Jul 2022 12:53:55 +0800 Subject: [PATCH] update docs for color option --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 8 +++++--- src/app.rs | 4 ++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 294119a..afad3b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,7 +100,7 @@ dependencies = [ [[package]] name = "clock-tui" -version = "0.2.0" +version = "0.2.1" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index 3ebd4ec..c400010 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clock-tui" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "MIT" description = "A clock app in terminal" diff --git a/README.md b/README.md index d918393..9912a2f 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ You can press `Space` key to _pause_ and _resume_ the stopwatch. You can customize the styles. -* Size +### Size You can use `-s` or `--size` option to custome clock size, for example: @@ -75,12 +75,14 @@ You can use `-s` or `--size` option to custome clock size, for example: $ tclock -s 2 ``` -* Color +### Color You can use `-c` or `--color` to set clock forground color, for exmaple: ```shell -# color name +# color name, any one of: +# Black, Red, Green, Yellow, Blue, Magenta, Cyan, Gray, DarkGray, LightRed, +# LightGreen, LightYellow, LightBlue, LightMagenta, LightCyan, White $ tclock -c yellow # or hex color diff --git a/src/app.rs b/src/app.rs index cb9bbcd..859e06b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -38,8 +38,12 @@ pub(crate) enum Mode { pub(crate) struct App { #[clap(subcommand)] pub mode: Option, + /// Forground color of the clock, possible values are: + /// a) Any one of: Black, Red, Green, Yellow, Blue, Magenta, Cyan, Gray, DarkGray, LightRed, LightGreen, LightYellow, LightBlue, LightMagenta, LightCyan, White. + /// b) Hexadecimal color code: #RRGGBB. #[clap(short, long, value_parser = parse_color, default_value = "green")] pub color: Color, + /// Size of the clock, should be a positive integer (>=1). #[clap(short, long, value_parser, default_value = "1")] pub size: u16,