diff --git a/src/MfGames.ToolBuilder/Extensions/ParseResultExtensions.cs b/src/MfGames.ToolBuilder/Extensions/ParseResultExtensions.cs index 786640a..6b1b848 100644 --- a/src/MfGames.ToolBuilder/Extensions/ParseResultExtensions.cs +++ b/src/MfGames.ToolBuilder/Extensions/ParseResultExtensions.cs @@ -7,11 +7,11 @@ namespace MfGames.ToolBuilder.Extensions { public static class ParseResultExtensions { - public static List ValueListForOption( + public static List GetValueListForOption( this ParseResult result, Option option) { - string? optionValues = result.ValueForOption(option); + string? optionValues = result.GetValueForOption(option); if (optionValues == null) { diff --git a/src/MfGames.ToolBuilder/GlobalOptionHelper.cs b/src/MfGames.ToolBuilder/GlobalOptionHelper.cs index 7c83ddd..35c44cf 100644 --- a/src/MfGames.ToolBuilder/GlobalOptionHelper.cs +++ b/src/MfGames.ToolBuilder/GlobalOptionHelper.cs @@ -35,7 +35,7 @@ namespace MfGames.ToolBuilder return defaultValue; } - TType value = results.ValueForOption(option)!; + TType value = results.GetValueForOption(option)!; return value; } diff --git a/src/MfGames.ToolBuilder/Globals/ConfigToolGlobalService.cs b/src/MfGames.ToolBuilder/Globals/ConfigToolGlobalService.cs index 119bf2a..8eeb429 100644 --- a/src/MfGames.ToolBuilder/Globals/ConfigToolGlobalService.cs +++ b/src/MfGames.ToolBuilder/Globals/ConfigToolGlobalService.cs @@ -19,10 +19,10 @@ namespace MfGames.ToolBuilder.Globals { this.ConfigOption = new Option( "--config", - "Configuration file to use for settings, otherwise a default will be used.", - ArgumentArity.OneOrMore) + "Configuration file to use for settings, otherwise a default will be used.") { AllowMultipleArgumentsPerToken = false, + Arity = ArgumentArity.OneOrMore, }; this.ConfigOption.AddAlias("-c"); @@ -129,7 +129,7 @@ namespace MfGames.ToolBuilder.Globals } var json = file.ReadAllText(); - TType result = JsonConvert.DeserializeObject(json); + TType result = JsonConvert.DeserializeObject(json)!; return result; } diff --git a/src/MfGames.ToolBuilder/MfGames.ToolBuilder.csproj b/src/MfGames.ToolBuilder/MfGames.ToolBuilder.csproj index 47cc525..a139ebf 100644 --- a/src/MfGames.ToolBuilder/MfGames.ToolBuilder.csproj +++ b/src/MfGames.ToolBuilder/MfGames.ToolBuilder.csproj @@ -7,37 +7,37 @@ - - + + - - - - - - - - - + + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + - + diff --git a/src/MfGames.ToolBuilder/Tables/TableToolService.cs b/src/MfGames.ToolBuilder/Tables/TableToolService.cs index f3277aa..8d140b6 100644 --- a/src/MfGames.ToolBuilder/Tables/TableToolService.cs +++ b/src/MfGames.ToolBuilder/Tables/TableToolService.cs @@ -138,7 +138,7 @@ namespace MfGames.ToolBuilder.Tables this.DefaultColumns?.ToList() ?? new List(); var optionColumns = context.ParseResult - .ValueListForOption(this.tableColumnOption) + .GetValueListForOption(this.tableColumnOption) .ToList(); List tableColumns = optionColumns.Count == 0 @@ -307,7 +307,7 @@ namespace MfGames.ToolBuilder.Tables private TableFormatType GetTableFormat(InvocationContext context) { string? tableFormat = - context.ParseResult.ValueForOption(this.tableFormatOption) + context.ParseResult.GetValueForOption(this.tableFormatOption) ?? nameof(TableFormatType.Minimal); if (!tableFormat.TryParseEnumFuzzy(out TableFormatType value)) @@ -433,7 +433,7 @@ namespace MfGames.ToolBuilder.Tables // We default to aligning numerical columns to the right. bool noAlign = - context.ParseResult.ValueForOption(this.noAlignTableOption); + context.ParseResult.GetValueForOption(this.noAlignTableOption); if (!noAlign) { diff --git a/tests/MfGames.ToolBuilder.Tests/MfGames.ToolBuilder.Tests.csproj b/tests/MfGames.ToolBuilder.Tests/MfGames.ToolBuilder.Tests.csproj index 3e77c78..7dc4253 100644 --- a/tests/MfGames.ToolBuilder.Tests/MfGames.ToolBuilder.Tests.csproj +++ b/tests/MfGames.ToolBuilder.Tests/MfGames.ToolBuilder.Tests.csproj @@ -7,28 +7,31 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/tests/SampleTool/CrashTopCommand.cs b/tests/SampleTool/CrashTopCommand.cs index 3485a7a..9a0c4e1 100644 --- a/tests/SampleTool/CrashTopCommand.cs +++ b/tests/SampleTool/CrashTopCommand.cs @@ -24,7 +24,7 @@ namespace SampleTool /// public Task InvokeAsync(InvocationContext context) { - bool messy = context.ParseResult.ValueForOption(this.messyOption); + bool messy = context.ParseResult.GetValueForOption(this.messyOption); if (messy) { diff --git a/tests/SampleTool/SampleTool.csproj b/tests/SampleTool/SampleTool.csproj index 38e4f5b..d9b0e68 100644 --- a/tests/SampleTool/SampleTool.csproj +++ b/tests/SampleTool/SampleTool.csproj @@ -6,7 +6,7 @@ - +