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

[Feature]: nuget CLI should know options "--version" and "--help" #11434

Closed
andreasabel opened this issue Dec 6, 2021 · 5 comments
Closed

[Feature]: nuget CLI should know options "--version" and "--help" #11434

andreasabel opened this issue Dec 6, 2021 · 5 comments
Labels
help wanted Considered good issues for community contributions. Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:NuGet.exe NuGet.exe Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Feature

Comments

@andreasabel
Copy link

NuGet Product(s) Involved

NuGet.exe

The Elevator Pitch

My first invocations of brew-installed nuget (brew install nuget):

$ nuget --help
Unknown command: '--help'
NuGet.Commands.CommandException: Unknown command: '--help'
  at NuGet.CommandLine.CommandManager.GetCommand (System.String commandName) [0x0004e] in <3468606d201847a5b9ffe12c0a3e91c9>:0 
  at NuGet.CommandLine.CommandLineParser.ParseCommandLine (System.Collections.Generic.IEnumerable`1[T] commandLineArgs) [0x00016] in <3468606d201847a5b9ffe12c0a3e91c9>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x0012b] in <3468606d201847a5b9ffe12c0a3e91c9>:0 
$ nuget --version
Unknown command: '--version'
NuGet.Commands.CommandException: Unknown command: '--version'
  at NuGet.CommandLine.CommandManager.GetCommand (System.String commandName) [0x0004e] in <3468606d201847a5b9ffe12c0a3e91c9>:0 
  at NuGet.CommandLine.CommandLineParser.ParseCommandLine (System.Collections.Generic.IEnumerable`1[T] commandLineArgs) [0x00016] in <3468606d201847a5b9ffe12c0a3e91c9>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x0012b] in <3468606d201847a5b9ffe12c0a3e91c9>:0 

Yeah, that doesn't shine.
Sure I got the right nuget?

Just any serious CLI will support --help and --version. How difficult to implement is that?

Additional Context and Details

$ which nuget
/usr/local/bin/nuget

$ l $(which nuget)
/usr/local/bin/nuget -> ../Cellar/nuget/5.11.0/bin/nuget
@JonDouglas
Copy link
Contributor

Try help or ?.

In .NET CLI, there is support for help and even options.

@kartheekp-ms kartheekp-ms added WaitingForCustomer Applied when a NuGet triage person needs more info from the OP Product:NuGet.exe NuGet.exe and removed Triage:Untriaged labels Dec 7, 2021
@kartheekp-ms
Copy link
Contributor

nuget help command produced following output which has version number also.

NuGet Version: 6.1.0.206
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.

Available commands:

 add               Adds the given package to a hierarchical source. http sources are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#add-command.

 client-certs      Provides the ability to manage list of client certificates located in NuGet.config files

 config            Gets or sets NuGet config values.

 delete            Deletes a package from the server.

 help (?)          Displays general help information and help information about other commands.

 init              Adds all the packages from the <srcPackageSourcePath> to the hierarchical <destPackageSourcePath>. http feeds are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#init-command.

 install           Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources, uses the default NuGet feed.

 list              Displays a list of packages from a given source. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used. If NuGet.config specifies no sources, uses the default NuGet feed.

 locals            Clears or lists local NuGet resources such as http requests cache, temp cache or machine-wide global packages folder.

 pack              Creates a NuGet package based on the specified nuspec or project file.

 push              Pushes a package to the server and publishes it.
                   NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config, then loading any nuget.config or .nuget\nuget.config starting from root of drive and ending in current directory.

 restore           Restores NuGet packages.

 search            Searches a given source using the query string provided. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used.

 setApiKey         Saves an API key for a given server URL. When no URL is provided API key is saved for the NuGet gallery.

 sign              Signs a NuGet package with the specified certificate.

 sources           Provides the ability to manage list of sources located in NuGet.config files.

 spec              Generates a nuspec for a new package. If this command is run in the same folder as a project file (.csproj, .vbproj, .fsproj), it will create a tokenized nuspec file.

 trusted-signers   Provides the ability to manage the list of trusted signers.

 update            Update packages to latest available versions. This command also updates NuGet.exe itself.

 verify            Verifies a signed NuGet package.

For more information, visit https://docs.nuget.org/docs/reference/command-line-reference

@andreasabel
Copy link
Author

But --help is standard. You could make it an alias for help. Cf.:

$ dotnet --help
.NET SDK (5.0.207)
Usage: dotnet [runtime-options] [path-to-application] [arguments]

Execute a .NET application.

...

Option --version is also standard. Cf.:

$ dotnet --version
5.0.207

@ghost ghost added WaitingForClientTeam Customer replied, needs attention from client team. Do not apply this label manually. and removed WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Dec 7, 2021
@kartheekp-ms kartheekp-ms added Triage:NeedsTriageDiscussion and removed WaitingForClientTeam Customer replied, needs attention from client team. Do not apply this label manually. labels Dec 11, 2021
@nkolev92 nkolev92 added Pipeline:Icebox help wanted Considered good issues for community contributions. Priority:2 Issues for the current backlog. Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Triage:NeedsTriageDiscussion Priority:2 Issues for the current backlog. labels Dec 13, 2021
@JonDouglas
Copy link
Contributor

Just any serious CLI will support --help and --version. How difficult to implement is that?

It's not difficult, but this would be making a change to a CLI that already was designed & implemented these command/options over 10 years ago and follows existing patterns of help <COMMAND>.

.NET CLI is the modern equivalent & includes support for both --help and --version.

But --help is standard. You could make it an alias for help. Cf.:

They are standard for CLIs that follow the GNU convention which includes the .NET CLI today.

Let's leave this issue open to collect 👍 and if there's enough demand to add these two standard options as aliases, we can consider it further.

@nkolev92
Copy link
Member

I'm gonna close this issue as dup of #6618 as that one is older.

@nkolev92 nkolev92 added the Resolution:Duplicate This issue appears to be a Duplicate of another issue label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Considered good issues for community contributions. Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:NuGet.exe NuGet.exe Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Feature
Projects
None yet
Development

No branches or pull requests

4 participants