-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Add documentation for this pattern:
// Command
public class MyData
{
[Handler("my-command")]
public void Execute(string csvFilePath)
{
if (File.Exists(csvFilePath))
{
...
}
}
public static IEnumerable<CompletionItem> GetFileNameCompletions(CompletionContext ctx)
{
string fn = ctx.WordToComplete;
string[] files = Directory.GetFiles(Environment.CurrentDirectory, fn + "*.csv");
return files.Select(f => new CompletionItem(f));
}
}// setup
builder.MapMyDataCommand(options =>
{
options.Command.Description = "Load something from a CSV file.";
options.CsvFilePathArgument.Description = "The file path to the CSV file where the data is stored.";
// map the command completions like this:
options.CsvFilePathArgument.CompletionSources.Add(MyData.GetFileNameCompletions);
});Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation