dotnet / dotnet/command-line-api

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

Open
#2,439 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.