Skip to content

Commit 2382fc0

Browse files
authored
Fix build error: Update migration guide for Command Line changes (#50394)
Clarified the mandatory nature of symbol names in constructors and updated the properties related to symbol names and aliases.
1 parent f728d04 commit 2382fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/standard/commandline/migration-guide-2.0.0-beta5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Moreover, to get the parsed value, you had to store a reference to an option or
6161
To promote simplicity and explicitness, the name of a symbol is now a mandatory parameter for every symbol constructor (including `Argument<T>`). The concept of a name and aliases is now separate: aliases are just aliases and don't include the name of the symbol. Of course, they're optional. As a result, the following changes were made:
6262

6363
- `name` is now a mandatory argument for every public constructor of <xref:System.CommandLine.Argument`1>, <xref:System.CommandLine.Option`1>, and <xref:System.CommandLine.Command>. In the case of `Argument<T>`, it isn't used for parsing, but to generate the help. In the case of `Option<T>` and `Command`, it's used to identify the symbol during parsing and also for help and completions.
64-
- The <xref:System.CommandLine.Symbol.Name?displayProperty=nameWithType> property is no longer `virtual`; it's now read-only and returns the name as it was provided when the symbol was created. Because of that, `Symbol.DefaultName` was removed and <xref:System.CommandLine.Option.Name?displayProperty=nameWithType> no longer removes the `--`, `-`, or `/` or any other prefix from the longest alias.
64+
- The <xref:System.CommandLine.Symbol.Name?displayProperty=nameWithType> property is no longer `virtual`; it's now read-only and returns the name as it was provided when the symbol was created. Because of that, `Symbol.DefaultName` was removed and <xref:System.CommandLine.Symbol.Name?displayProperty=nameWithType> no longer removes the `--`, `-`, or `/` or any other prefix from the longest alias.
6565
- The `Aliases` property exposed by [`Option`](xref:System.CommandLine.Option.Aliases) and [`Command`](xref:System.CommandLine.Command.Aliases) is now a mutable collection. This collection no longer includes the name of the symbol.
6666
- `System.CommandLine.Parsing.IdentifierSymbol` was removed (it was a base type for both `Command` and `Option`).
6767

0 commit comments

Comments
 (0)