mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
23 lines
652 B
C#
23 lines
652 B
C#
using System.Collections.Generic;
|
|
using CliFx.Schema;
|
|
|
|
namespace CliFx.Input;
|
|
|
|
internal class OptionInput(string identifier, IReadOnlyList<string> values)
|
|
{
|
|
public string Identifier { get; } = identifier;
|
|
|
|
public IReadOnlyList<string> Values { get; } = values;
|
|
|
|
public bool IsHelpOption => OptionSchema.ImplicitHelpOption.MatchesIdentifier(Identifier);
|
|
|
|
public bool IsVersionOption => OptionSchema.ImplicitVersionOption.MatchesIdentifier(Identifier);
|
|
|
|
public string GetFormattedIdentifier() =>
|
|
Identifier switch
|
|
{
|
|
{ Length: >= 2 } => "--" + Identifier,
|
|
_ => '-' + Identifier,
|
|
};
|
|
}
|