Add local search for simulation batches
This commit is contained in:
1 parent
4c4a80b10c
commit
ed57c0cd42
12 files changed
+606
-19
No files matched your search
@@ -205,13 +205,32 @@ export async function handleSimulationCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === "list") {
|
||||
if (action === "list" || action === "search") {
|
||||
const query =
|
||||
stringOption(args.options.query) ??
|
||||
stringOption(args.options.q) ??
|
||||
(action === "search" ? maybeName : undefined);
|
||||
if (action === "search" && (!query || !query.trim())) {
|
||||
throw usageError(
|
||||
"Usage: seal-use simulation search <keyword> [--since 7d] [--until <time>] [--all]"
|
||||
);
|
||||
}
|
||||
|
||||
const limit = numberOption(args.options.limit);
|
||||
// search 默认扫到底(受 --max-scan 保护), 避免只搜到最近 50 个;显式 --limit 时按用户范围
|
||||
const all = booleanOption(args.options.all) ?? (action === "search" ? limit === undefined : false);
|
||||
|
||||
await runCapability(
|
||||
"sealSimulationBatchesList",
|
||||
client,
|
||||
corp,
|
||||
{
|
||||
limit: numberOption(args.options.limit)
|
||||
limit,
|
||||
all,
|
||||
maxScan: numberOption(args.options.maxScan) ?? numberOption(args.options["max-scan"]),
|
||||
query,
|
||||
since: stringOption(args.options.since) ?? stringOption(args.options["created-after"]),
|
||||
until: stringOption(args.options.until) ?? stringOption(args.options["created-before"])
|
||||
},
|
||||
outputOptions(args.options)
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user