Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JKamsker committed Mar 15, 2024
1 parent f689941 commit 0c92a70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ public class LionCommand : Command<LionSettings>, IAsyncCommandCompletable
return 0;
}

public async Task<CompletionResult> GetSuggestionsAsync(ICommandParameterInfo parameter, string? prefix)
public async Task<CompletionResult> 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)
{
Expand All @@ -149,6 +149,15 @@ public class LionCommand : Command<LionSettings>, 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<string>
Expand All @@ -165,7 +174,7 @@ public class LionCommand : Command<LionSettings>, IAsyncCommandCompletable

return new CompletionResult(bestMatches, bestMatches.Any());
})
.MatchAsync(parameter, prefix)
.MatchAsync(parameter)
.WithPreventDefault();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<PackageIcon>logo_small_128x128.png</PackageIcon>
<PackageReadmeFile>Readme.Nuget.md</PackageReadmeFile>
<PackageReleaseNotes />
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<PackageReleaseNotes />
<Version>0.0.6</Version>

</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -64,11 +63,12 @@
<PackageOutputPath>$(SolutionDir)\..\.artifacts\</PackageOutputPath>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<Version>0.0.5</Version>
<Deterministic>True</Deterministic>



<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo_small_128x128.png</PackageIcon>
<PackageReadmeFile>Readme.Nuget.md</PackageReadmeFile>

<!-- Symbols -->
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down

0 comments on commit 0c92a70

Please sign in to comment.