diff --git a/cmd/ipfs2/ipfs.go b/cmd/ipfs2/ipfs.go index 402ce55a7..d6f256d54 100644 --- a/cmd/ipfs2/ipfs.go +++ b/cmd/ipfs2/ipfs.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + cmds "github.com/jbenet/go-ipfs/commands" commands "github.com/jbenet/go-ipfs/core/commands2" ) @@ -55,6 +57,11 @@ type cmdDetails struct { doesNotUseRepo bool } +func (d *cmdDetails) String() string { + return fmt.Sprintf("on client? %t, on daemon? %t, uses repo? %t", + d.canRunOnClient(), d.canRunOnDaemon(), d.usesRepo()) +} + func (d *cmdDetails) canRunOnClient() bool { return !d.cannotRunOnClient } func (d *cmdDetails) canRunOnDaemon() bool { return !d.cannotRunOnDaemon } func (d *cmdDetails) usesRepo() bool { return !d.doesNotUseRepo } diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index f394ec980..0742bf47c 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -276,6 +276,7 @@ func commandShouldRunOnDaemon(req cmds.Request, root *cmds.Command) (bool, error if !found { details = cmdDetails{} // defaults } + log.Debugf("cmd perms for +%v: %s", path, details.String()) if details.cannotRunOnClient && details.cannotRunOnDaemon { return false, fmt.Errorf("command disabled: %s", path[0])