func is(ctx context.Context, key contextKey, def bool) bool {
	bv, ok := ctx.Value(key).(bool)
	if !ok {
		return def
	}
	return bv
}
is is a helper function for returning the value of a bool from the context
or the provided default.
package leaf
import (
	"context"
	"github.com/gopasspw/gopass/internal/store"
)
type contextKey int
const (
	ctxKeyFsckCheck contextKey = iota
	ctxKeyFsckForce
	ctxKeyFsckFunc
	ctxKeyCheckRecipients
	ctxKeyFsckDecrypt
	ctxKeyNoGitOps
)
func WithFsckCheck(ctx context.Context, check bool) context.Context {
	return context.WithValue(ctx, ctxKeyFsckCheck, check)
}
func HasFsckCheck(ctx context.Context) bool {
	return hasBool(ctx, ctxKeyFsckCheck)
}
func IsFsckCheck(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyFsckCheck).(bool)
	if !ok {
		return false
	}
	return bv
}
func WithFsckForce(ctx context.Context, force bool) context.Context {
	return context.WithValue(ctx, ctxKeyFsckForce, force)
}
func HasFsckForce(ctx context.Context) bool {
	return hasBool(ctx, ctxKeyFsckForce)
}
func IsFsckForce(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyFsckForce).(bool)
	if !ok {
		return false
	}
	return bv
}
func WithFsckFunc(ctx context.Context, imf store.FsckCallback) context.Context {
	return context.WithValue(ctx, ctxKeyFsckFunc, imf)
}
func HasFsckFunc(ctx context.Context) bool {
	imf, ok := ctx.Value(ctxKeyFsckFunc).(store.FsckCallback)
	return ok && imf != nil
}
func GetFsckFunc(ctx context.Context) store.FsckCallback {
	imf, ok := ctx.Value(ctxKeyFsckFunc).(store.FsckCallback)
	if !ok || imf == nil {
		return func(context.Context, string) bool {
			return true
		}
	}
	return imf
}
func WithCheckRecipients(ctx context.Context, cr bool) context.Context {
	return context.WithValue(ctx, ctxKeyCheckRecipients, cr)
}
func HasCheckRecipients(ctx context.Context) bool {
	return hasBool(ctx, ctxKeyCheckRecipients)
}
func IsCheckRecipients(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyCheckRecipients).(bool)
	if !ok {
		return false
	}
	return bv
}
func WithFsckDecrypt(ctx context.Context, d bool) context.Context {
	return context.WithValue(ctx, ctxKeyFsckDecrypt, d)
}
func IsFsckDecrypt(ctx context.Context) bool {
	return is(ctx, ctxKeyFsckDecrypt, false)
}
func WithNoGitOps(ctx context.Context, d bool) context.Context {
	return context.WithValue(ctx, ctxKeyNoGitOps, d)
}
func IsNoGitOps(ctx context.Context) bool {
	return is(ctx, ctxKeyNoGitOps, false)
}
func hasBool(ctx context.Context, key contextKey) bool {
	_, ok := ctx.Value(key).(bool)
	return ok
}