urfave / cli

A simple, fast, and fun package for building command line apps in Go

Home Page:https://cli.urfave.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is MigrateGlobalFlags still necessary with the latest version of urfave/cli?

joohhnnn opened this issue · comments

Hello,

I've come across the MigrateGlobalFlags function, which seems to have been created to address a limitation in earlier versions of the urfave/cli library. I understand that this function was implemented to make sure global flags are available in the context of subcommands.

However, I've read that this function may no longer be necessary after the merge of #1245. I am unsure if this issue has already been resolved in the latest version of urfave/cli.

Can you please confirm if the latest version of urfave/cli has addressed this issue, and if so, is the MigrateGlobalFlags function now redundant?

Thank you for your assistance!

@joohhnnn Where is this function ? I dont see it in v1/v2/v3 codebase.

@joohhnnn Where is this function ? I dont see it in v1/v2/v3 codebase.

MigrateGlobalFlags is used in go-etheruem with older version urfave, which means Does it still require external sorting of global commands in the latest version of urfave, or has it been incorporated internally?

Yes v3/main branch has support for Persistent flags at any level. Any flags defined as persistent at App level will be available to all commands and subcommands. Any flag defined as persistent for a particular command will be available to just that command's subcommands,

Yes v3/main branch has support for Persistent flags at any level. Any flags defined as persistent at App level will be available to all commands and subcommands. Any flag defined as persistent for a particular command will be available to just that command's subcommands,

thanks