ajalt / clikt

Multiplatform command line interface parsing for Kotlin
https://ajalt.github.io/clikt/
Apache License 2.0
2.57k stars 124 forks source link

Question: one single argument for multiple repeating subcommands #506

Closed alegomes closed 6 months ago

alegomes commented 8 months ago

Following you suggestion on #505, I'm using the subcommand chaining strategy. However, I ran into the issue bellow:

In the following example:

myCmd subCmd1 --optA=x subCmd2 --optB=y anArgument

Is it possible to make anArgument an argument of both subcommands subCmd1 and subCmd2?

thanks!

ajalt commented 8 months ago

No, but you can pass information between subcommands with a context object