From a269e46017a1e5c926827975fc389dced1de181c Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 14 Oct 2014 10:49:01 +0200 Subject: [PATCH] fix setupCmdContext() for subcommands (fixes #163) --- cmd/ipfs/ipfs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index 96a463cbaf4..9877adf3420 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -184,7 +184,7 @@ type cmdContext struct { // setupCmdContext initializes a cmdContext structure from a given command. func setupCmdContext(c *commander.Command, online bool) (cc cmdContext, err error) { rootCmd := c - for ; rootCmd.Parent != nil; rootCmd = c.Parent { + for ; rootCmd.Parent != nil; rootCmd = rootCmd.Parent { } cc.configDir, err = getConfigDir(rootCmd)