Added --help

This commit is contained in:
Ultradesu
2026-07-28 11:18:14 +01:00
parent abf9ad782c
commit 29466d70e8
2 changed files with 22 additions and 1 deletions
Generated
+1 -1
View File
@@ -1566,7 +1566,7 @@ dependencies = [
[[package]]
name = "furumi_tui"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"anyhow",
"blake3",
+21
View File
@@ -20,8 +20,29 @@ use crossterm::event::{
PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags,
};
const HELP: &str = "\
Furumi — federated terminal music player
Usage:
furumi [OPTION]
Options:
-h, --help Show this help
-V, --version Show version
--status Print a one-line now-playing status
--status-json
Print now-playing status as JSON
tmux:
set -g status-right '#(furumi --status)'
";
fn main() -> Result<()> {
let args: Vec<_> = std::env::args_os().collect();
if args.iter().any(|arg| arg == "--help" || arg == "-h") {
print!("{HELP}");
return Ok(());
}
if args.iter().any(|arg| arg == "--version" || arg == "-V") {
println!("furumi {}", env!("CARGO_PKG_VERSION"));
return Ok(());