提交 a269e460 作者: Henry

fix setupCmdContext() for subcommands (fixes #163)

上级 707f7018
...@@ -184,7 +184,7 @@ type cmdContext struct { ...@@ -184,7 +184,7 @@ type cmdContext struct {
// setupCmdContext initializes a cmdContext structure from a given command. // setupCmdContext initializes a cmdContext structure from a given command.
func setupCmdContext(c *commander.Command, online bool) (cc cmdContext, err error) { func setupCmdContext(c *commander.Command, online bool) (cc cmdContext, err error) {
rootCmd := c rootCmd := c
for ; rootCmd.Parent != nil; rootCmd = c.Parent { for ; rootCmd.Parent != nil; rootCmd = rootCmd.Parent {
} }
cc.configDir, err = getConfigDir(rootCmd) cc.configDir, err = getConfigDir(rootCmd)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论