fix(cli): preserve native option descriptions in help

Keep the optional address description visible to incur and describe the actual
bundle plist default and absolute-path support. Extend the existing command
help sweep instead of traversing the inventory a second time.

Refs: #1418
Co-authored-by: Fazmin <fazmin.nizam@gmail.com>
This commit is contained in:
morluto
2026-10-11 06:41:46 +08:00
co-authored by Fazmin
parent 95a77b6e25
commit 8b4c96e6c6
3 changed files with 8 additions and 2 deletions
@@ -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 () => {