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

Deprecate :: in favor of @ in dotnet new install command #45422

Open
Forgind opened this issue Dec 12, 2024 · 8 comments
Open

Deprecate :: in favor of @ in dotnet new install command #45422

Forgind opened this issue Dec 12, 2024 · 8 comments
Assignees
Labels
Area-CLI untriaged Request triage from a team member

Comments

@Forgind
Copy link
Member

Forgind commented Dec 12, 2024

Per #45156 (comment)

The syntax is currently dotnet new install package::version. It would be good to change it to dotnet new install package@version. We may also want to look to see if there are other instances of :: used as a delimiter where we could change it to @

Thanks @am11 for bringing this up!

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Dec 12, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@baronfel
Copy link
Member

I approve this - in general we should adopt this syntax for versioned things across the CLI. Next up would be the NuGet commands, which @JonDouglas expressed general approval for in #42367 (comment) as well.

@am11
Copy link
Member

am11 commented Dec 12, 2024

Thanks for considering this. I just recalled the conversation we had in an old PR when we were adding dotnet-new-install display template in nuget.org website: NuGet/NuGetGallery#7548. Explicit --version with @ shorthand for all version arguments is an impressive idea! Easy to remember syntax.

@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Dec 12, 2024

I worried that @ might have to be quoted in PowerShell, because I have seen commands like git log @{u} fail in PowerShell; but apparently PowerShell parses @ as the splatting operator only when it's at the beginning of a word, not when it is part of package@version.

@am11
Copy link
Member

am11 commented Dec 12, 2024

Another option is perhaps =. Below are examples of various tools and how they define versions:

  • cargo install <name> --version <version> (uses --version)
  • apt install <name>=<version> (uses =)
  • apk add <name>=<version> (uses =)
  • npm install <name>@<version> (uses @)
  • pip install <name>==<version> (uses ==)
  • choco install <name> --version=<version> (uses --version=)
  • winget install <name> --version <version> (uses --version)
  • gem install <name> -v <version> (uses -v)
  • brew install <name>@<version> (uses @)
  • pnpm add <name>@<version> (uses @)
  • yay -S <name> --version=<version> (uses --version=)

@Forgind
Copy link
Member Author

Forgind commented Dec 12, 2024

I worried that @ might have to be quoted in PowerShell, because I have seen commands like git log @{u} fail in PowerShell; but apparently PowerShell parses @ as the splatting operator only when it's at the beginning of a word, not when it is part of package@version.

I didn't even consider this. Thanks for checking!

@marcpopMSFT
Copy link
Member

Triage: add the new command in 10 and add a warning when customers use :: and then in 11 we should remove the old command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CLI untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

5 participants