https://play.golang.org/p/Sga78gMLn-9
You can then use it like './mycli -d stream -rt' The '-d' option is a shared flag, and `-rt' is dedicated for the subcommand 'stream'. On Wednesday, May 6, 2020 at 8:08:25 PM UTC+8, Chris Burkert wrote: > > Dear all, > > I'd like to mix shared flags with flags specific to flag sets (cooltool > <globalFlags> <subcommand> <commandFlags>). However I struggle to parse the > shared flags only and pass the rest to the flagset for parsing. Here is > what I came up with: > > https://play.golang.org/p/Jazn3aSX9-d > > Do I have to pick a different flag library or can this be done with > package flag from the standard library? > > Thanks - Chris > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1c81e2be-0920-4872-887e-19981a0543d1%40googlegroups.com.