Skip to content

Commit ae6e5de

Browse files
betegonclaude
andcommitted
feat(help): show alias hints inline with parent commands
Instead of just hiding plural aliases, show them as muted hints next to their parent command (e.g. "alias: sentry issues" next to issue). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d481d6e commit ae6e5de

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/lib/help.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ import {
2424

2525
const TAGLINE = "The command-line interface for Sentry";
2626

27+
/** Singular route name → plural shortcut (e.g. "issue" → "issues") */
28+
const SHORTCUT_ALIASES: Record<string, string> = {
29+
issue: "issues",
30+
org: "orgs",
31+
project: "projects",
32+
repo: "repos",
33+
team: "teams",
34+
log: "logs",
35+
span: "spans",
36+
trace: "traces",
37+
trial: "trials",
38+
};
39+
2740
type HelpCommand = {
2841
usage: string;
2942
description: string;
@@ -52,9 +65,13 @@ function generateCommands(): HelpCommand[] {
5265
const subNames = subEntries
5366
.map((sub: RouteMapEntry) => sub.name.original)
5467
.join(" | ");
68+
const alias = SHORTCUT_ALIASES[routeName];
69+
const description = alias
70+
? `${brief} (alias: sentry ${alias})`
71+
: brief;
5572
return {
5673
usage: `sentry ${routeName} ${subNames}`,
57-
description: brief,
74+
description,
5875
};
5976
}
6077

0 commit comments

Comments
 (0)