提交 c99e9e60 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

feat(details) add funcs to negate negations

not immediately useful, but nice to have

tagging you to make sure i didn't make a mistake here @jbenet

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 5c4fa5a7
...@@ -55,6 +55,10 @@ type cmdDetails struct { ...@@ -55,6 +55,10 @@ type cmdDetails struct {
doesNotUseRepo bool doesNotUseRepo bool
} }
func (d *cmdDetails) canRunOnClient() bool { return !d.cannotRunOnClient }
func (d *cmdDetails) canRunOnDaemon() bool { return !d.cannotRunOnDaemon }
func (d *cmdDetails) usesRepo() bool { return !d.doesNotUseRepo }
// "What is this madness!?" you ask. Our commands have the unfortunate problem of // "What is this madness!?" you ask. Our commands have the unfortunate problem of
// not being able to run on all the same contexts. This map describes these // not being able to run on all the same contexts. This map describes these
// properties so that other code can make decisions about whether to invoke a // properties so that other code can make decisions about whether to invoke a
......
...@@ -281,7 +281,7 @@ func commandShouldRunOnDaemon(req cmds.Request, root *cmds.Command) (bool, error ...@@ -281,7 +281,7 @@ func commandShouldRunOnDaemon(req cmds.Request, root *cmds.Command) (bool, error
return false, fmt.Errorf("command disabled: %s", path[0]) return false, fmt.Errorf("command disabled: %s", path[0])
} }
if details.doesNotUseRepo && !details.cannotRunOnClient { if details.doesNotUseRepo && details.canRunOnClient() {
return false, nil return false, nil
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论