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

Why are we inferring the root command when it is required to be passed into the Tokenizer.Tokenize call? #2439

Open PonchoPowers opened 3 months ago

PonchoPowers commented 3 months ago

Why are we inferring the root command when it is required to be passed into the Tokenizer.Tokenize call? The logic doesn't really make much sense because on one hand you are saying provide me with a root command, then you proceed to ignore it if inferRootCommand is set to true.

Also, if not mistaken, the root command name is meaningless because you can simply rename the program and then the root command name would change, so if inferred, it can't be relied upon as the user can simply change the name of the exe, so the only benefit of inferring it would be when logging or output to the console, in which case you would use the CliExecutable to get the name anyway.