mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-05 03:58:16 +08:00
Make -v|--version
opt-in
We added an automatic version option in 0.49. We did this with good intentions, but forgot that people might already use --version as an option for a root command. This commit makes -v|--version completely opt-in.
This commit is contained in:

committed by
Patrik Svensson

parent
88515b7d7f
commit
3acc90e47c
@ -3,6 +3,7 @@ namespace Spectre.Console.Cli;
|
||||
internal sealed class CommandModel : ICommandContainer, ICommandModel
|
||||
{
|
||||
public string? ApplicationName { get; }
|
||||
public string? ApplicationVersion { get; }
|
||||
public ParsingMode ParsingMode { get; }
|
||||
public IList<CommandInfo> Commands { get; }
|
||||
public IList<string[]> Examples { get; }
|
||||
@ -20,9 +21,10 @@ internal sealed class CommandModel : ICommandContainer, ICommandModel
|
||||
IEnumerable<string[]> examples)
|
||||
{
|
||||
ApplicationName = settings.ApplicationName;
|
||||
ApplicationVersion = settings.ApplicationVersion;
|
||||
ParsingMode = settings.ParsingMode;
|
||||
Commands = new List<CommandInfo>(commands ?? Array.Empty<CommandInfo>());
|
||||
Examples = new List<string[]>(examples ?? Array.Empty<string[]>());
|
||||
Commands = new List<CommandInfo>(commands);
|
||||
Examples = new List<string[]>(examples);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user