File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,18 @@ use clap::Parser;
55
66use 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 ) ]
1115struct 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+ }
You can’t perform that action at this time.
0 commit comments