mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Cleanup
This commit is contained in:
@@ -71,10 +71,9 @@ internal partial class CommandOptionSymbol
|
||||
{
|
||||
var attribute = TryGetOptionAttribute(property);
|
||||
|
||||
if (attribute is null)
|
||||
return null;
|
||||
|
||||
return FromAttribute(attribute);
|
||||
return attribute is not null
|
||||
? FromAttribute(attribute)
|
||||
: null;
|
||||
}
|
||||
|
||||
public static bool IsOptionProperty(IPropertySymbol property) =>
|
||||
|
||||
@@ -10,9 +10,9 @@ internal partial class CommandParameterSymbol
|
||||
public int Order { get; }
|
||||
|
||||
public string? Name { get; }
|
||||
|
||||
|
||||
public bool? IsRequired { get; }
|
||||
|
||||
|
||||
public ITypeSymbol? ConverterType { get; }
|
||||
|
||||
public IReadOnlyList<ITypeSymbol> ValidatorTypes { get; }
|
||||
@@ -41,7 +41,7 @@ internal partial class CommandParameterSymbol
|
||||
|
||||
private static CommandParameterSymbol FromAttribute(AttributeData attribute)
|
||||
{
|
||||
var order = (int) attribute
|
||||
var order = (int)attribute
|
||||
.ConstructorArguments
|
||||
.Select(a => a.Value)
|
||||
.First()!;
|
||||
@@ -51,7 +51,7 @@ internal partial class CommandParameterSymbol
|
||||
.Where(a => a.Key == "Name")
|
||||
.Select(a => a.Value.Value)
|
||||
.FirstOrDefault() as string;
|
||||
|
||||
|
||||
var isRequired = attribute
|
||||
.NamedArguments
|
||||
.Where(a => a.Key == "IsRequired")
|
||||
|
||||
Reference in New Issue
Block a user