


The following example shows two options: dotnet tool update dotnet-suggest -verbosity quiet -globalĪs this example illustrates, the value of the option may be explicit ( quiet for -verbosity) or implicit (nothing follows -global). The POSIX convention is to prefix the option name with two hyphens ( -). OptionsĪn option is a named parameter that can be passed to a command. In dotnet tool install, install is a subcommand of tool. Subcommands can have their own subcommands. For example, the dotnet command has a run subcommand that you invoke by entering dotnet run. Most command-line apps support subcommands, also known as verbs. For example, the dotnet command specifies the dotnet.exe executable. The root command is the one that specifies the name of the app's executable. There are other tool-related commands, such as tool uninstall, tool list, and tool update. In dotnet tool install, install is a command that specifies an action, and tool is a command that specifies a group of related commands.In dotnet run, run is a command that specifies an action.Here's an example: dotnet tool search "ef migrations add"Ī command in command-line input is a token that specifies an action or defines a group of related actions. The following table shows how System.CommandLine interprets the preceding example: TokenĪ token can contain spaces if it's enclosed in quotation marks ( "). The command-line app that is being invoked determines how the tokens after the first one are interpreted. Tokens are interpreted as commands, options, or arguments. This input is parsed by the dotnet application into tokens tool, install, dotnet-suggest, -global, -verbosity, and quiet. For example, consider the following command line: dotnet tool install dotnet-suggest -global -verbosity quiet System.CommandLine parses command-line input into tokens, which are strings delimited by spaces. The information will be useful to users as well as developers of.

This article explains the command-line syntax that System.CommandLine recognizes. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Some information relates to prerelease product that may be substantially modified before it's released. System.CommandLine is currently in PREVIEW, and this documentation is for version 2.0 beta 4.
