Skip to content

Commit 1f895ea

Browse files
author
Test User
committed
fix(cli): restore detailed help output
1 parent 34971b8 commit 1f895ea

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/main.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ use clap::Parser;
55

66
use git_workers::app;
77

8+
/// Command-line arguments for Git Workers
9+
///
10+
/// Currently supports minimal CLI arguments as the application is primarily
11+
/// interactive. Future versions may add support for direct command execution.
812
#[derive(Parser)]
913
#[command(name = "gw")]
1014
#[command(about = "Interactive Git Worktree Manager", long_about = None)]
1115
struct Cli {
16+
/// Print version information and exit
17+
///
18+
/// When specified, prints the version number from Cargo.toml and exits
19+
/// without entering the interactive mode.
1220
#[arg(short, long)]
1321
version: bool,
1422
}
@@ -24,3 +32,20 @@ fn main() -> Result<()> {
2432

2533
app::run()
2634
}
35+
36+
#[cfg(test)]
37+
mod tests {
38+
use super::*;
39+
use clap::CommandFactory;
40+
41+
#[test]
42+
fn test_help_includes_version_description() {
43+
let mut command = Cli::command();
44+
let help = command.render_long_help().to_string();
45+
46+
assert!(help.contains("Print version information and exit"));
47+
assert!(
48+
help.contains("When specified, prints the version number from Cargo.toml and exits")
49+
);
50+
}
51+
}

0 commit comments

Comments
 (0)