This commit is contained in:
Tyrrrz
2023-05-16 01:36:03 +03:00
parent 01f29a5375
commit e52781c25a
61 changed files with 1264 additions and 1345 deletions

View File

@@ -19,7 +19,7 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzerSpecs
public class MyCommand : ICommand
{
[CommandOption('f', IsRequired = false)]
public required string Foo { get; set; }
public required string Foo { get; init; }
public ValueTask ExecuteAsync(IConsole console) => default;
}
@@ -39,8 +39,8 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzerSpecs
[Command]
public class MyCommand : ICommand
{
[CommandOption('f', IsRequired = true)]
public required string Foo { get; set; }
[CommandOption('f')]
public required string Foo { get; init; }
public ValueTask ExecuteAsync(IConsole console) => default;
}
@@ -61,7 +61,7 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzerSpecs
public class MyCommand : ICommand
{
[CommandOption('f', IsRequired = false)]
public string Foo { get; set; }
public string? Foo { get; init; }
public ValueTask ExecuteAsync(IConsole console) => default;
}
@@ -81,8 +81,8 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzerSpecs
[Command]
public class MyCommand : ICommand
{
[CommandOption('f', IsRequired = true)]
public string Foo { get; set; }
[CommandOption('f')]
public required string Foo { get; init; }
public ValueTask ExecuteAsync(IConsole console) => default;
}
@@ -102,7 +102,7 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzerSpecs
[Command]
public class MyCommand : ICommand
{
public required string Foo { get; set; }
public required string Foo { get; init; }
public ValueTask ExecuteAsync(IConsole console) => default;
}