diff --git a/CliFx/Parsing/CommandOptionToken.cs b/CliFx/Parsing/CommandOptionToken.cs index 1772fa2..8e4dd39 100644 --- a/CliFx/Parsing/CommandOptionToken.cs +++ b/CliFx/Parsing/CommandOptionToken.cs @@ -16,7 +16,7 @@ public class CommandOptionToken(string identifier, IReadOnlyList values) identifier switch { { Length: >= 2 } => "--" + identifier, - _ => '-' + identifier + _ => '-' + identifier, }; /// diff --git a/CliFx/Schema/CommandInputSchema.cs b/CliFx/Schema/CommandInputSchema.cs index fadd722..96d9766 100644 --- a/CliFx/Schema/CommandInputSchema.cs +++ b/CliFx/Schema/CommandInputSchema.cs @@ -143,26 +143,25 @@ internal static class CommandInputSchemaExtensions { CommandParameterSchema => "Parameter", CommandOptionSchema => "Option", - _ => throw new InvalidOperationException("Unknown input schema type.") + _ => throw new InvalidOperationException("Unknown input schema type."), }; public static string GetFormattedIdentifier(this CommandInputSchema schema) => schema switch { - CommandParameterSchema parameter - => parameter.IsSequence ? $"<{parameter.Name}>" : $"<{parameter.Name}...>", - CommandOptionSchema option - => option switch - { - { Name: not null, ShortName: not null } - => $"-{option.ShortName}|--{option.Name}", - { Name: not null } => $"--{option.Name}", - { ShortName: not null } => $"-{option.ShortName}", - _ - => throw new InvalidOperationException( - "Option must have a name or a short name." - ) - }, - _ => throw new ArgumentOutOfRangeException(nameof(schema)) + CommandParameterSchema parameter => parameter.IsSequence + ? $"<{parameter.Name}>" + : $"<{parameter.Name}...>", + + CommandOptionSchema option => option switch + { + { Name: not null, ShortName: not null } => $"-{option.ShortName}|--{option.Name}", + { Name: not null } => $"--{option.Name}", + { ShortName: not null } => $"-{option.ShortName}", + _ => throw new InvalidOperationException( + "Option must have a name or a short name." + ), + }, + _ => throw new ArgumentOutOfRangeException(nameof(schema)), }; }