aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-09-10 01:11:33 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-09-10 01:11:33 +0530
commitef6e3a4006522da925004fdcbbc531c520844fb6 (patch)
tree067a9a0c298d9aeecd270d0b6a955bc9cf3d72e6
parente4fce03ca9c043c8cc99d5f7e1657f1e2beeb662 (diff)
Added help message
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs20
3 files changed, 20 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5700523..dd240e6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -24,7 +24,7 @@ dependencies = [
[[package]]
name = "polydoro"
-version = "0.1.0"
+version = "0.1.1"
dependencies = [
"bincode",
]
diff --git a/Cargo.toml b/Cargo.toml
index 74ededa..1408682 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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);
}
}