Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(cli): preserve native option descriptions in help

morluto8b4c96e6c6b3
diff --git a/src/cli/coreNativeCommands.ts b/src/cli/coreNativeCommands.ts
index a00f41cdf..77ded7347 100644
--- a/src/cli/coreNativeCommands.ts
+++ b/src/cli/coreNativeCommands.ts
@@ -188,7 +188,7 @@ export const registerCoreNativeCommands = (
}),
options: z.object({
type: z.string().optional().describe("Exact database type category path"),
- address: z.string().describe("Exact native address").optional(),
+ address: z.string().optional().describe("Exact native address"),
"target-format": formatSelectionOption,
provider: providerSelectionOption,
}),
diff --git a/src/cli/utilityCommands.ts b/src/cli/utilityCommands.ts
index 47cb9e5bc..9c380eaff 100644
--- a/src/cli/utilityCommands.ts
+++ b/src/cli/utilityCommands.ts
@@ -169,7 +169,7 @@ const registerNativeCommands = (
.string()
.optional()
.describe(
- "Plist path relative to the app root (default: Contents/Info.plist)",
+ "Plist path relative to the app root, or an absolute path (default: the bundle's Info.plist)",
),
}),
run: ({ args, options }) =>
diff --git a/tests/boundary/cli/cliOptionAliases.test.ts b/tests/boundary/cli/cliOptionAliases.test.ts
index 4bdedf2da..9e109aa2b 100644
--- a/tests/boundary/cli/cliOptionAliases.test.ts
+++ b/tests/boundary/cli/cliOptionAliases.test.ts
@@ -41,6 +41,7 @@ describe("CLI option aliases", () => {
it("register only single-character short flags", async () => {
const cli = createCli({});
const invalid: string[] = [];
+ const undescribed: string[] = [];
for (const command of createCliInventory(cli).primary) {
for (const [option, short] of Object.entries(
registeredAliases(cli, command),
@@ -52,8 +53,13 @@ describe("CLI option aliases", () => {
const help = await serve(cli, [command, "--help"]);
for (const match of help.stdout.matchAll(/(?:^|[\s,])-([a-z][\w-]+)/gmu))
invalid.push(`${command} help: -${match[1] ?? ""}`);
+ const options = /^Options:\n((?: {2}.*\n?)*)/mu.exec(help.stdout)?.[1];
+ for (const line of options?.split("\n") ?? [])
+ if (/^ {2}--\S+(?: <[^>]+>)?\s*$/u.test(line))
+ undescribed.push(`${command} ${line.trim()}`);
}
expect(invalid).toEqual([]);
+ expect(undescribed).toEqual([]);
});
it("accepts kebab-case long options without registered aliases", async () => {