diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-09-10 01:09:23 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-09-10 01:09:23 +0530 |
commit | 1965a620ca76019983c4089088b939ba3f4b2b6b (patch) | |
tree | 9cb440e161d51a953269c1ddb6912d2748d27c9a | |
parent | e4fce03ca9c043c8cc99d5f7e1657f1e2beeb662 (diff) |
Added help messagev0.1.1
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 20 |
2 files changed, 19 insertions, 3 deletions
@@ -6,7 +6,7 @@ homepage = "https://git.vidhukant.com/polydoro/about" repository = "https://git.vidhukant.com/polydoro" readme = "README.md" keywords = ["pomodoro", "polybar", "statusbar", "widget", "lemonbar"] -version = "0.1.0" +version = "0.1.1" edition = "2024" [dependencies] diff --git a/src/main.rs b/src/main.rs index b66df77..6042929 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,6 +20,20 @@ use std::env; mod client; mod daemon; +fn print_usage() { + println!("Polydoro - Pomodoro widget for polybar and friends\n"); + println!("Usage:"); + println!("\tUse the -d flag to start the daemon (only one daemon can be running)"); + println!("\tUse the -l flag to listen to the daemon. Use this to print to your status bar/script."); + println!("\trun:\t\tStart/resume the timer"); + println!("\tpause:\t\tPause the timer"); + println!("\ttoggle:\t\tConditionally run/pause"); + println!("\tskip:\t\tSkip the current timer (timer needs to be in a running state)"); + println!("\tsoft-reset:\tGo to the beginning of the current timer"); + println!("\thard-reset:\tGo to the beginning of the first timer"); + println!("\treset:\t\tConditional soft/hard reset"); +} + fn main() { let args: Vec<String> = env::args().collect(); @@ -28,9 +42,11 @@ fn main() { "run" | "pause" | "toggle" | "skip" | "soft-reset" | "hard-reset" | "reset" => client::command::handle_command(args[1].clone()), "-d" => daemon::start_daemon(), "-l" => client::listener::start_listener(), - "-h" | _ => eprintln!("<help message>"), + "-h" | _ => { print_usage(); }, } } else { - eprintln!("<help message>"); + println!("Invalid usage"); + print_usage(); + std::process::exit(1); } } |