File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,17 @@ private static void SetupMSBuildEnvironmentInvariants()
198
198
199
199
private static string GetCommandName ( ParseResult r )
200
200
{
201
+ if ( r . Action is Parser . PrintVersionAction )
202
+ {
203
+ // If the action is PrintVersionAction, we return the command name as "dotnet --version"
204
+ return "dotnet --version" ;
205
+ }
206
+ else if ( r . Action is Parser . PrintInfoAction )
207
+ {
208
+ // If the action is PrintHelpAction, we return the command name as "dotnet --help"
209
+ return "dotnet --info" ;
210
+ }
211
+
201
212
// walk the parent command tree to find the top-level command name and get the full command name for this parseresult
202
213
List < string > parentNames = [ r . CommandResult . Command . Name ] ;
203
214
var current = r . CommandResult . Parent ;
You can’t perform that action at this time.
0 commit comments