Msbuild: Support `--` as well as `/` and `-` for command line options

Created on 4 Sep 2020  路  8Comments  路  Source: dotnet/msbuild

The dotnet usage help for msbuild is inconsistent.

Generally, dotnet commands uses either --help or -h to display help:
dotnet build -h ' displays usage help
dotnet build --help ' also displays usage help

For the dotnet msbuild command, however, its inconsistent:
dotnet msbuild -h ' displays usage help
dotnet msbuild --help ' displays error message (_INCONSISTENT_)
dotnet msbuild -help ' also displays usage help (_INCONSISTENT_)

It may seem like a minor issue, but command line usage consistency is important for product usability. It's the small inconsistencies like this that can lead to frustration. If you're not going to follow dotnet core's usage syntax, then don't include it as a dotnet core command. If you must include it as a dotnet core command, then add dotnet core's equivalent switches.

Most helpful comment

Team triage: please keep -help and friends working. It's different from but a superset of the dotnet options, but it doesn't regress anyone who has been using the form that we've been using in documentation for a while now.

So support /option, -option, and --option.

All 8 comments

Team Triage: This is a legacy of being initially designed as a windows-only application. It should be possible to additionally support -- options.

I would like to work on this issue.
Should I be assigned to this item while working on it (from now on)?

Hey @BartoszKlonowski , I've assigned the issue to you and removed the up-for-grabs label. Ask us any questions here, thanks for the help!

Thanks, @BenVillalobos for assigning the item. I've got a question about the scope of this issue:

In your comment, you've said:

It should be possible to additionally support -- options.

But in the issue's description I can also see the second case:

dotnet msbuild -help ' also displays usage help (INCONSISTENT)

which is separating long version (considered when "--") from short version (considered when "-" or "/").
For consistency it should also be covered, but on the other hand it would mess with backward compatibility (-help would no longer be available, as dotnet -help shows an error).

Can you share your thoughts on this? Perhaps Team Triage has already discussed it.

Great question, we didn't nail down the specifics of this. I wonder what could possibly break if we downgrade a command like dotnet msbuild -help to an error state? As it stands, /h and /help are consistent with both dotnet build and dotnet msbuild, they all display help messages.

My guess is that we'll decide to match functionality with dotnet with the caveat that we don't regress any existing inconsistencies. This would enable both dotnet msbuild -help and dotnet msbuild --help. At least that way we're ... consistently inconsistent 馃憖

We'll discuss this in our bug triage meeting Wednesday morning and get back to you then!

Thanks!
Meanwhile I've implemented the part for accepting double-dash '--', but I can't push to origin and set-upstream my branch with changes for this issue. Even if SSH key is added and repository is cloned using SSH I'm still getting error:

ERROR: Permission to dotnet/msbuild.git denied to BartoszKlonowski.

Sorry for bothering you with this, but are there any permissions required beside signing CLA?
Who can I contact about this problem?

Even if SSH key is added and repository is cloned using SSH I'm still getting error:

The problem might be that you're working straight off of a clone of this repo. You want to fork it first (button on the top right corner of the page), then clone your fork and work off of some development branch you create on it.

Team triage: please keep -help and friends working. It's different from but a superset of the dotnet options, but it doesn't regress anyone who has been using the form that we've been using in documentation for a while now.

So support /option, -option, and --option.

Was this page helpful?
0 / 5 - 0 ratings