File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,23 @@ public void NoPathAndLogfileShouldUseCurrentDirectoryTargetDirectory()
55
55
}
56
56
57
57
[ Test ]
58
- public void HMeansIsHelp ( )
58
+ public void HelpSwitchTest ( )
59
59
{
60
60
var arguments = argumentParser . ParseArguments ( "-h" ) ;
61
61
Assert . IsNull ( arguments . TargetPath ) ;
62
62
Assert . IsNull ( arguments . LogFilePath ) ;
63
63
arguments . IsHelp . ShouldBe ( true ) ;
64
64
}
65
65
66
+ [ Test ]
67
+ public void VersionSwitchTest ( )
68
+ {
69
+ var arguments = argumentParser . ParseArguments ( "-version" ) ;
70
+ Assert . IsNull ( arguments . TargetPath ) ;
71
+ Assert . IsNull ( arguments . LogFilePath ) ;
72
+ arguments . IsVersion . ShouldBe ( true ) ;
73
+ }
74
+
66
75
[ Test ]
67
76
public void Exec ( )
68
77
{
Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ public Arguments ParseArguments(string[] commandLineArguments)
63
63
{
64
64
return new Arguments
65
65
{
66
- TargetPath = System . Environment . CurrentDirectory ,
67
66
IsHelp = true ,
68
67
} ;
69
68
}
@@ -72,7 +71,6 @@ public Arguments ParseArguments(string[] commandLineArguments)
72
71
{
73
72
return new Arguments
74
73
{
75
- TargetPath = System . Environment . CurrentDirectory ,
76
74
IsVersion = true ,
77
75
} ;
78
76
}
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public class Arguments
52
52
53
53
public GitVersionOptions ToOptions ( )
54
54
{
55
- var workingDirectory = TargetPath . TrimEnd ( '/' , '\\ ' ) ;
55
+ var workingDirectory = TargetPath ? . TrimEnd ( '/' , '\\ ' ) ;
56
56
57
57
return new GitVersionOptions
58
58
{
You can’t perform that action at this time.
0 commit comments