From 698629b153b67a940ec7daaa69555c1acf16c772 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Mon, 20 Apr 2020 16:52:51 +0300 Subject: [PATCH] Disable nullability checks for older target frameworks --- CliFx/CliFx.csproj | 5 +++++ CliFx/Domain/CommandSchema.cs | 4 ++-- CliFx/Domain/HelpTextWriter.cs | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CliFx/CliFx.csproj b/CliFx/CliFx.csproj index c9733a3..641cd57 100644 --- a/CliFx/CliFx.csproj +++ b/CliFx/CliFx.csproj @@ -18,6 +18,11 @@ snupkg + + + annotations + + <_Parameter1>$(AssemblyName).Tests diff --git a/CliFx/Domain/CommandSchema.cs b/CliFx/Domain/CommandSchema.cs index f797cb9..1f24e0d 100644 --- a/CliFx/Domain/CommandSchema.cs +++ b/CliFx/Domain/CommandSchema.cs @@ -210,8 +210,8 @@ namespace CliFx.Domain type, attribute?.Name, attribute?.Description, - parameters, - options + parameters!, + options! ); } } diff --git a/CliFx/Domain/HelpTextWriter.cs b/CliFx/Domain/HelpTextWriter.cs index cdf703a..cdb6c00 100644 --- a/CliFx/Domain/HelpTextWriter.cs +++ b/CliFx/Domain/HelpTextWriter.cs @@ -279,9 +279,9 @@ namespace CliFx.Domain foreach (var childCommand in childCommands) { var relativeCommandName = - string.IsNullOrWhiteSpace(childCommand.Name) || string.IsNullOrWhiteSpace(command.Name) - ? childCommand.Name - : childCommand.Name.Substring(command.Name.Length + 1); + !string.IsNullOrWhiteSpace(command.Name) + ? childCommand.Name!.Substring(command.Name.Length + 1) + : childCommand.Name!; // Name RenderIndent();