clikt icon indicating copy to clipboard operation
clikt copied to clipboard

Question: one single argument for multiple repeating subcommands

Open alegomes opened this issue 10 months ago • 1 comments

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!

alegomes avatar Apr 02 '24 19:04 alegomes

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

ajalt avatar Apr 02 '24 19:04 ajalt