go-cobra

Share properties from separate commands/process

ぐ巨炮叔叔 提交于 2019-12-22 08:23:55
问题 Im providing command line tool with several command and sub commands, Im using cobra command line and I’ve two separate commands that first is prerequisit e to other e.g. the first command is preferring the environment by creating temp folder and validate some file The second command should get some properties from the first command and user should execute it like btr prepare btr run when the run command is executed it should get some data from the prepare command outcome // rootCmd

Share properties from separate commands/process

折月煮酒 提交于 2019-12-05 12:43:34
Im providing command line tool with several command and sub commands, Im using cobra command line and I’ve two separate commands that first is prerequisit e to other e.g. the first command is preferring the environment by creating temp folder and validate some file The second command should get some properties from the first command and user should execute it like btr prepare btr run when the run command is executed it should get some data from the prepare command outcome // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "btr", Short: