From 0c92a7072d89bf7e5ae710afaff5e282c9eb895f Mon Sep 17 00:00:00 2001 From: JKamsker <11245306+JKamsker@users.noreply.github.com> Date: Fri, 15 Mar 2024 01:42:28 +0100 Subject: [PATCH] Update readme --- README.md | 17 +++++++++++++---- .../JKToolKit.Spectre.AutoCompletion.csproj | 14 +++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9cd905e..8c2f6cf 100644 --- a/README.md +++ b/README.md @@ -132,15 +132,15 @@ public class LionCommand : Command, IAsyncCommandCompletable return 0; } - public async Task GetSuggestionsAsync(ICommandParameterInfo parameter, string? prefix) + public async Task GetSuggestionsAsync(IMappedCommandParameter parameter, ICompletionContext context) { - if(string.IsNullOrEmpty(prefix)) + if (string.IsNullOrEmpty(parameter.Value)) { return CompletionResult.None(); } return await this.MatchAsync() - .Add(x => x.Age, (prefix) => + .Add(x => x.Legs, (prefix) => { if (prefix.Length != 0) { @@ -149,6 +149,15 @@ public class LionCommand : Command, IAsyncCommandCompletable return "16"; }) + .Add(x => x.Teeth, (prefix) => + { + if (prefix.Length != 0) + { + return FindNextEvenNumber(prefix); + } + + return "32"; + }) .Add(x => x.Name, prefix => { var names = new List @@ -165,7 +174,7 @@ public class LionCommand : Command, IAsyncCommandCompletable return new CompletionResult(bestMatches, bestMatches.Any()); }) - .MatchAsync(parameter, prefix) + .MatchAsync(parameter) .WithPreventDefault(); } } diff --git a/src/JKToolKit.Spectre.AutoCompletion/JKToolKit.Spectre.AutoCompletion.csproj b/src/JKToolKit.Spectre.AutoCompletion/JKToolKit.Spectre.AutoCompletion.csproj index ee69ac5..6c9b124 100644 --- a/src/JKToolKit.Spectre.AutoCompletion/JKToolKit.Spectre.AutoCompletion.csproj +++ b/src/JKToolKit.Spectre.AutoCompletion/JKToolKit.Spectre.AutoCompletion.csproj @@ -6,11 +6,10 @@ enable 10.0 AnyCPU - logo_small_128x128.png - Readme.Nuget.md - - MIT + + 0.0.6 + @@ -64,11 +63,12 @@ $(SolutionDir)\..\.artifacts\ True - 0.0.5 True - - + MIT + logo_small_128x128.png + Readme.Nuget.md + True snupkg