Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet CLI: "dotnet help new" does not work #45231

Closed
ajpinedam opened this issue Dec 1, 2024 · 4 comments · Fixed by #45282
Closed

dotnet CLI: "dotnet help new" does not work #45231

ajpinedam opened this issue Dec 1, 2024 · 4 comments · Fixed by #45282
Labels
Milestone

Comments

@ajpinedam
Copy link
Contributor

Describe the bug

dotnet help new following the documentation and how similar commands behave should open the new command documentation website. Instead, this is different from the current behavior on 9.0.100. Executing that command returns the help command information.

Tested this on Windows, macOS, and Linux (Mint).

Below is a sample running on macOS:

dotnet_help_new.mov

To Reproduce

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
dotnet --info
~ dotnet --info
.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.c6f19616
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.6
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.100/

.NET workloads installed:
 [wasm-tools]
   Installation Source: SDK 9.0.100
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.workload.mono.toolchain.current/9.0.0/WorkloadManifest.json
   Install Type:        FileBased

 [macos]
   Installation Source: SDK 9.0.100
   Manifest Version:    15.0.9617/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.macos/15.0.9617/WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: SDK 9.0.100
   Manifest Version:    18.0.9617/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.ios/18.0.9617/WorkloadManifest.json
   Install Type:        FileBased

 [maccatalyst]
   Installation Source: SDK 9.0.100
   Manifest Version:    18.0.9617/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maccatalyst/18.0.9617/WorkloadManifest.json
   Install Type:        FileBased

 [maui]
   Installation Source: SDK 9.0.100
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: SDK 9.0.100
   Manifest Version:    35.0.7/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.android/35.0.7/WorkloadManifest.json
   Install Type:        FileBased

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  6.0.425 [/usr/local/share/dotnet/sdk]
  7.0.317 [/usr/local/share/dotnet/sdk]
  8.0.401 [/usr/local/share/dotnet/sdk]
  8.0.404 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.33 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.33 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Workloads untriaged Request triage from a team member labels Dec 1, 2024
@ajpinedam
Copy link
Contributor Author

For whoever is triaging this issue, I would like to try it and find a fix for it.

@Forgind
Copy link
Member

Forgind commented Dec 2, 2024

Some commands seem to act this way, and others don't. dotnet new seems like a reasonable one to do what you expect. (Its spew seems to be because it's throwing an error currently.)

I'll mark it for team triage. If we get consensus, I can assign it to you, and we'd welcome a PR for it 🙂

@Forgind Forgind added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Dec 2, 2024
@baronfel
Copy link
Member

baronfel commented Dec 2, 2024

What's happening here is that the NewCommand isn't an DocumentedCommand and so we just write the usage of the dotnet CLI itself. This is maybe not the best experience. We should do the following:

  • NewCommand can't be a DocumentedCommand due to multiple inheritance so we'd need another marker interface to signal a docs url, and then incorporate that into TryGetDocsLink
  • If TryGetDocsLink fails but the command is a known command (it parses successfully) we should just write the Help output for that command. For example dotnet help new should be the same as dotnet new --help if no url is available.
  • Only show the usage we do today if the command given to dotnet help is completely unknown.

@ajpinedam
Copy link
Contributor Author

@baronfel Thanks for the details.

I understand that the option of adding an interface that both DocumentedComand and NewCommand implement, something like ICommandDocument and then checking on the TryGetDocsLink method for that interface should give us what we need.

I can put a draft PR to keep the discussion there.

@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label Dec 10, 2024
@marcpopMSFT marcpopMSFT added this to the 10.0.1xx milestone Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants