1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 18:13:54 +08:00

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: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-11-13 15:31:15 -08:00
committed by Juan Batiz-Benet
parent 5c4fa5a783
commit c99e9e6000
2 changed files with 5 additions and 1 deletions

View File

@ -55,6 +55,10 @@ type cmdDetails struct {
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
// 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

View File

@ -281,7 +281,7 @@ func commandShouldRunOnDaemon(req cmds.Request, root *cmds.Command) (bool, error
return false, fmt.Errorf("command disabled: %s", path[0])
}
if details.doesNotUseRepo && !details.cannotRunOnClient {
if details.doesNotUseRepo && details.canRunOnClient() {
return false, nil
}