Use C#8 features and cleanup

This commit is contained in:
Alexey Golub
2019-11-13 20:31:48 +02:00
parent 85caa275ae
commit 9690c380d3
66 changed files with 381 additions and 523 deletions

View File

@@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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"})
{