feat(management): additive Skip/Take paging on template/instance lists (arch-review P2)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -212,19 +212,25 @@ public static class InstanceCommands
|
||||
var siteIdOption = new Option<int?>("--site-id") { Description = "Filter by site ID" };
|
||||
var templateIdOption = new Option<int?>("--template-id") { Description = "Filter by template ID" };
|
||||
var searchOption = new Option<string?>("--search") { Description = "Search term" };
|
||||
var skipOption = new Option<int>("--skip") { Description = "Offset paging: number of items to skip (default 0)" };
|
||||
var takeOption = new Option<int?>("--take") { Description = "Offset paging: max items to return (1..1000; omit for unlimited)" };
|
||||
|
||||
var cmd = new Command("list") { Description = "List instances" };
|
||||
cmd.Add(siteIdOption);
|
||||
cmd.Add(templateIdOption);
|
||||
cmd.Add(searchOption);
|
||||
cmd.Add(skipOption);
|
||||
cmd.Add(takeOption);
|
||||
cmd.SetAction(async (ParseResult result) =>
|
||||
{
|
||||
var siteId = result.GetValue(siteIdOption);
|
||||
var templateId = result.GetValue(templateIdOption);
|
||||
var search = result.GetValue(searchOption);
|
||||
var skip = result.GetValue(skipOption);
|
||||
var take = result.GetValue(takeOption);
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, urlOption, formatOption, usernameOption, passwordOption,
|
||||
new ListInstancesCommand(siteId, templateId, search));
|
||||
new ListInstancesCommand(siteId, templateId, search, skip, take));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user