fix(cli): preserve lazy placeholder options

This commit is contained in:
Peter Steinberger
2026-04-26 04:37:36 +01:00
parent e74f2e1501
commit 0ca9c4dcb0
4 changed files with 75 additions and 4 deletions

View File

@@ -28,9 +28,14 @@ type BrowserCommandGroupDefinition = {
register: BrowserCommandRegistrar;
};
const command = (name: string, description: string): CommandGroupPlaceholder => ({
const command = (
name: string,
description: string,
options?: CommandGroupPlaceholder["options"],
): CommandGroupPlaceholder => ({
name,
description,
...(options ? { options } : {}),
});
const browserCommandGroupDefinitions: readonly BrowserCommandGroupDefinition[] = [
@@ -48,6 +53,9 @@ const browserCommandGroupDefinitions: readonly BrowserCommandGroupDefinition[] =
command("profiles", "List all browser profiles"),
command("create-profile", "Create a new browser profile"),
command("delete-profile", "Delete a browser profile"),
command("doctor", "Check browser plugin readiness", [
{ flags: "--deep", description: "Run a live snapshot probe" },
]),
],
register: async (args) => {
const module = await import("./browser-cli-manage.js");
@@ -105,7 +113,6 @@ const browserCommandGroupDefinitions: readonly BrowserCommandGroupDefinition[] =
command("highlight", "Highlight an element by ref"),
command("errors", "Get recent page errors"),
command("requests", "Get recent network requests (best-effort)"),
command("doctor", "Check browser plugin readiness"),
command("trace", "Record a Playwright trace"),
],
register: async (args) => {