Skip to content

feat(subcommand): support alias for subcommand#155

Closed
fu050409 wants to merge 1 commit intounjs:mainfrom
fu050409:feat/subcommand-alias
Closed

feat(subcommand): support alias for subcommand#155
fu050409 wants to merge 1 commit intounjs:mainfrom
fu050409:feat/subcommand-alias

Conversation

@fu050409
Copy link
Copy Markdown
Contributor

@fu050409 fu050409 commented Jul 5, 2024

Support alias for subCommand

Resolved: #152

export type CommandDef<T extends ArgsDef = ArgsDef> = {
meta?: Resolvable<CommandMeta>;
args?: Resolvable<T>;
alias?: Resolvable<string | string[]>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit, maybe this should actually be in a SubCommandDef

you can't alias the root command since it is the 'argless' execution afaict

so maybe SubCommandsDef should actually be Record<string, Resolvable<SubCommandDef<any>>>, where SubCommandDef is just CommandDef<T> & {alias?: Resolvable<string | string[]>}

what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review, this is an early PR, it took me some time to understand it.😂

I agree with you and I will try to revise it later.

@pi0 pi0 mentioned this pull request Mar 15, 2026
7 tasks
@pi0
Copy link
Copy Markdown
Member

pi0 commented Mar 15, 2026

Thanks for PR ❤️ Landing via #236

@pi0 pi0 closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create alias for subcommand

3 participants