File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ fn build_version_info() -> String {
4242
4343fn main ( ) {
4444 // Handle version request with custom formatting before parsing
45- if std:: env:: args ( ) . any ( |arg| arg == "--version" || arg == "-V" ) {
45+ // Only handle version if it's a direct flag, not part of exec command
46+ let args: Vec < String > = std:: env:: args ( ) . collect ( ) ;
47+ let is_version_request = args. len ( ) == 2 && ( args[ 1 ] == "--version" || args[ 1 ] == "-V" ) ;
48+
49+ if is_version_request {
4650 println ! ( "{}" , build_version_info( ) ) ;
4751 return ;
4852 }
Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ Describe "Ruby Butler - Help System" {
3333 It " Shows version with --version flag" {
3434 $Output = & $Script :RbPath -- version 2>&1
3535 $LASTEXITCODE | Should - Be 0
36- $Output | Should -Match " rb \d+\.\d+\.\d+"
36+ ( $Output -join " " ) | Should -Match " Ruby Butler v \d+\.\d+\.\d+"
3737 }
3838
3939 It " Shows version with -V flag" {
4040 $Output = & $Script :RbPath - V 2>&1
4141 $LASTEXITCODE | Should - Be 0
42- $Output | Should -Match " rb \d+\.\d+\.\d+"
42+ ( $Output -join " " ) | Should -Match " Ruby Butler v \d+\.\d+\.\d+"
4343 }
4444 }
4545}
You can’t perform that action at this time.
0 commit comments