dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.38k stars 380 forks source link

Location can't be both implicit and explicit #2437

Open PonchoPowers opened 3 months ago

PonchoPowers commented 3 months ago

The following code exists in the Tokenizer.Tokenize method:

var rootIsExplicit = FirstArgIsRootCommand(args, rootCommand, inferRootCommand);
var rootLocation = Location.CreateRoot(rootCommand.Name, rootIsExplicit, rootIsExplicit ? 0 : -1);

Keep in mind that rootIsExplicit specifies "Explicit".

The Location.CreateRoot method signature is as follows:

internal static Location CreateRoot(string exeName, bool isImplicit, int start)

Note that it is asking if the location is "Implicit".

There appears to be a discrepancy between whether the location is implicit or explicit.