Skip to content

Commit

Permalink
enh: use readonly collection instead of array (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: Sang Au <[email protected]>
  • Loading branch information
auvansang authored Oct 21, 2024
1 parent a202845 commit f2298a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/CertGen/CommandOptions/CreateEcdsaCommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed class CreateEcdsaCommandOptionsBinder(
Option<string> certName,
Option<Algorithm> algorithm,
Option<NamedCurve> namedCurve,
Option<string[]> dnsNames,
Option<IReadOnlyCollection<string>> dnsNames,
Option<string?> pfxPassword,
Option<string?> organizationName,
Option<string?> organizationUnitName,
Expand Down
5 changes: 2 additions & 3 deletions src/CertGen/CommandOptions/CreateRsaCommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed class CreateRsaCommandOptionsBinder(
Option<string> certName,
Option<Algorithm> algorithm,
Option<int> keySize,
Option<string[]> dnsNames,
Option<IReadOnlyCollection<string>> dnsNames,
Option<string?> pfxPassword,
Option<string?> organizationName,
Option<string?> organizationUnitName,
Expand All @@ -28,8 +28,7 @@ public sealed class CreateRsaCommandOptionsBinder(
commonName
)
{
protected override CreateRsaCommandOptions GetBoundValue([NotNull
] BindingContext bindingContext) =>
protected override CreateRsaCommandOptions GetBoundValue([NotNull] BindingContext bindingContext) =>
base.GetBoundValue(bindingContext) with
{
KeySize = bindingContext.ParseResult.GetValueForOption(keySize)
Expand Down
2 changes: 1 addition & 1 deletion src/CertGen/CommandOptions/GlobalOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public record GlobalOptions
public abstract class GlobalOptionsBinder<TOptions>(
Option<string> certName,
Option<Algorithm> algorithm,
Option<string[]> dnsNames,
Option<IReadOnlyCollection<string>> dnsNames,
Option<string?> pfxPassword,
Option<string?> organizationName,
Option<string?> organizationUnitName,
Expand Down
2 changes: 1 addition & 1 deletion src/CertGen/Handlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static Command Initialize()

algorithmOption.AddAlias("-a");

var dnsNamesOption = new Option<string[]>(
var dnsNamesOption = new Option<IReadOnlyCollection<string>>(
name: "--dns-names",
description: "DNS names for the certificate",
getDefaultValue: () => ["localhost"]
Expand Down

0 comments on commit f2298a9

Please sign in to comment.