mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Use C#8 features and cleanup
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Services;
|
||||
|
||||
@@ -9,7 +8,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
public class CliFxCommand : ICommand
|
||||
{
|
||||
[CommandOption("str", 's')]
|
||||
public string StrOption { get; set; }
|
||||
public string? StrOption { get; set; }
|
||||
|
||||
[CommandOption("int", 'i')]
|
||||
public int IntOption { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
public class CliprCommand
|
||||
{
|
||||
[NamedArgument('s', "str")]
|
||||
public string StrOption { get; set; }
|
||||
public string? StrOption { get; set; }
|
||||
|
||||
[NamedArgument('i', "int")]
|
||||
public int IntOption { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
public class CommandLineParserCommand
|
||||
{
|
||||
[Option('s', "str")]
|
||||
public string StrOption { get; set; }
|
||||
public string? StrOption { get; set; }
|
||||
|
||||
[Option('i', "int")]
|
||||
public int IntOption { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
public class McMasterCommand
|
||||
{
|
||||
[Option("--str|-s")]
|
||||
public string StrOption { get; set; }
|
||||
public string? StrOption { get; set; }
|
||||
|
||||
[Option("--int|-i")]
|
||||
public int IntOption { get; set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
public class PowerArgsCommand
|
||||
{
|
||||
[ArgShortcut("--str"), ArgShortcut("-s")]
|
||||
public string StrOption { get; set; }
|
||||
public string? StrOption { get; set; }
|
||||
|
||||
[ArgShortcut("--int"), ArgShortcut("-i")]
|
||||
public int IntOption { get; set; }
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CliFx.Benchmarks.Commands
|
||||
{
|
||||
new Option(new[] {"--str", "-s"})
|
||||
{
|
||||
Argument = new Argument<string>()
|
||||
Argument = new Argument<string?>()
|
||||
},
|
||||
new Option(new[] {"--int", "-i"})
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user