citty
citty copied to clipboard
Create shared args for all `subCommands` in main
trafficstars
Describe the feature
Hi!
Sometimes we need to create global args because all subcommands will use them. It's complex and duplicate if we define them in all of our subCommands' defination.
Can we provide an api to create shared args?
Additional information
- [X] Would you be willing to help implement this feature?
maybe you can call the
generateArgs function to do this outside citty
There's a workaround for this.
const sharedArgs = { argName: { type: 'string', ... } }
export default defineCommand({ args: { ...sharedArgs, otherArg: { ... } } })