[PR #1395] [MERGED] fix(cli): stop advertising multi-letter single-dash option aliases #2852

Closed
opened 2026-10-17 21:11:02 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1395
Author: @kaoru0822-kitauji
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/cli-long-option-aliases


📝 Commits (1)

  • 815a19a fix(cli): stop advertising multi-letter single-dash option aliases

📊 Changes

7 files changed (+71 additions, -34 deletions)

View changed files

📝 src/cli/artifactCommands.ts (+0 -9)
📝 src/cli/coreBinaryCommands.ts (+0 -5)
📝 src/cli/coreNativeCommands.ts (+0 -13)
📝 src/cli/electronCommands.ts (+0 -1)
📝 src/cli/setupCommands.ts (+0 -1)
📝 src/cli/utilityCommands.ts (+0 -5)
➕ tests/boundary/cli/cliOptionAliases.test.ts (+71 -0)

📄 Description

Problem

Incur's per-command alias map registers one-letter short flags: the parser reads -abc as the stacked flags -a -b -c. Incur also accepts the kebab-case spelling of every camelCase option, so --case-sensitive already works without any alias.

Twenty options across 12 commands registered their own kebab-case long name as an "alias" (for example caseSensitive: "case-sensitive"). As a result, --help (and generated completions) advertised spellings that the parser rejects:

$ rea search --help
  --case-sensitive, -case-sensitive  Match the pattern with exact letter case

$ rea search /bin/ls foo -case-sensitive
code: UNKNOWN
message: "Unknown flag: -c"

$ rea inspect-plist /Applications/XLD.app -relative-path Contents/Info.plist
code: UNKNOWN
message: "Unknown flag: -r"

Affected: analyze, analyze-javascript-application, inspect-artifact (-integrity-policy), search, trace (-case-sensitive), inspect-plist (-relative-path), decode-interface-builder (-max-documents/-objects/-connections), inspect-native-dispatch-metadata (-max-records), trace-native-values, trace-native-ui-action, capture-native-ui-scenario, observe-native-ui (-max-*, -window-id), and uninstall (-purge-data).

Change

  • Remove the redundant multi-letter alias entries (and one empty alias: {}). The real short flag setup -y is unchanged.
  • The --long-name spellings keep working through Incur's kebab-case normalization.

Tests

New tests/boundary/cli/cliOptionAliases.test.ts:

  • every registered alias on a primary command is a single character, and no --help output advertises a multi-letter single-dash flag (fails on main with all 20 entries listed);
  • --relative-path still parses without a registered alias.

Verification:

  • npm run test:focused -- tests/boundary/cli/*.test.ts (42 files, 200 passed)
  • npm run check:fast, npm run docs:check

No contract, schema or MCP change. No Hopper/Ghidra verification needed (CLI parsing only).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1395 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/cli-long-option-aliases` --- ### 📝 Commits (1) - [`815a19a`](https://github.com/morluto/rea/commit/815a19a5b45e48fc5ad19856d76c55000510ad0d) fix(cli): stop advertising multi-letter single-dash option aliases ### 📊 Changes **7 files changed** (+71 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/artifactCommands.ts` (+0 -9) 📝 `src/cli/coreBinaryCommands.ts` (+0 -5) 📝 `src/cli/coreNativeCommands.ts` (+0 -13) 📝 `src/cli/electronCommands.ts` (+0 -1) 📝 `src/cli/setupCommands.ts` (+0 -1) 📝 `src/cli/utilityCommands.ts` (+0 -5) ➕ `tests/boundary/cli/cliOptionAliases.test.ts` (+71 -0) </details> ### 📄 Description ## Problem Incur's per-command `alias` map registers **one-letter short flags**: the parser reads `-abc` as the stacked flags `-a -b -c`. Incur also accepts the kebab-case spelling of every camelCase option, so `--case-sensitive` already works without any alias. Twenty options across 12 commands registered their own kebab-case long name as an "alias" (for example `caseSensitive: "case-sensitive"`). As a result, `--help` (and generated completions) advertised spellings that the parser rejects: ``` $ rea search --help --case-sensitive, -case-sensitive Match the pattern with exact letter case $ rea search /bin/ls foo -case-sensitive code: UNKNOWN message: "Unknown flag: -c" $ rea inspect-plist /Applications/XLD.app -relative-path Contents/Info.plist code: UNKNOWN message: "Unknown flag: -r" ``` Affected: `analyze`, `analyze-javascript-application`, `inspect-artifact` (`-integrity-policy`), `search`, `trace` (`-case-sensitive`), `inspect-plist` (`-relative-path`), `decode-interface-builder` (`-max-documents/-objects/-connections`), `inspect-native-dispatch-metadata` (`-max-records`), `trace-native-values`, `trace-native-ui-action`, `capture-native-ui-scenario`, `observe-native-ui` (`-max-*`, `-window-id`), and `uninstall` (`-purge-data`). ## Change - Remove the redundant multi-letter alias entries (and one empty `alias: {}`). The real short flag `setup -y` is unchanged. - The `--long-name` spellings keep working through Incur's kebab-case normalization. ## Tests New `tests/boundary/cli/cliOptionAliases.test.ts`: - every registered alias on a primary command is a single character, and no `--help` output advertises a multi-letter single-dash flag (fails on main with all 20 entries listed); - `--relative-path` still parses without a registered alias. Verification: - `npm run test:focused -- tests/boundary/cli/*.test.ts` (42 files, 200 passed) - `npm run check:fast`, `npm run docs:check` No contract, schema or MCP change. No Hopper/Ghidra verification needed (CLI parsing only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2852
No description provided.