unjs / citty

🌆 Elegant CLI Builder
Other
805 stars 26 forks source link

Create alias for subcommand #152

Open fu050409 opened 4 months ago

fu050409 commented 4 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 4 months ago

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