unjs / citty

🌆 Elegant CLI Builder
Other
729 stars 23 forks source link

Create alias for subcommand #152

Open fu050409 opened 2 months ago

fu050409 commented 2 months ago

Describe the feature

Hey! Sometimes we faced with a situation that we should create alias for subcommands. For example, pnpm i and pnpm install. The subcommand named i and subcommand named install is the same command.

The solution now is to create two subcommands with same value, like:

subCommands: { i: installCommand, install: installCommand }

But this looks not so elegant. Can we support alias parameter for defineCommand? I can work for my issue.

Additional information

zuixinwang commented 1 month ago

it's a good idea, but the help output should also be considered