Suppress `Alias` in help text option description?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 373
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
The program below prints help text that gives the user alias help text in two locations:
import { initTRPC } from "@trpc/server";
import { createCli } from "trpc-cli";
import { z } from "zod";
const t = initTRPC.create();
const router = t.router({
add: t.procedure
.meta({})
.input(
z.object({
left: z.number().meta({ alias: "l", description: "Left number" }),
right: z.number().meta({ alias: "r", description: "Right number" }),
})
)
.query(({ input }) => input.left + input.right),
});
createCli({ router }).run();
The help text:
Usage: index add [options]
Options:
-l, --left <number> Left number; Alias: l
-r, --right <number> Right number; Alias: r
-h, --help display help for command
Is there a way to hide/not print the Alias: l and Alias: r. They're redundant, given that -l, --left/-r, --right is printed at the start of the line.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the createCli({ router }).run() entry point and trace how the schema metadata is rendered in command help. Compare the generated option description with the reported output and determine whether the redundant alias text can be suppressed. Done means help shows -l, --left and -r, --right with their descriptions but without the appended Alias text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100