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