Skip to content

Conversation

@fu050409
Copy link

@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
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
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.

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

2 participants