feat: enhanced error messages for cloud and oss specific commands (#347)
* feat: enhanced error messages for cloud and oss specific commands * chore: rename test
This commit is contained in:
26
pkg/cli/context/context.go
Normal file
26
pkg/cli/context/context.go
Normal file
@ -0,0 +1,26 @@
|
||||
package context
|
||||
|
||||
import "github.com/urfave/cli"
|
||||
|
||||
const (
|
||||
contextKeyCloudOnly = "cloudOnly"
|
||||
contextKeyOssOnly = "ossOnly"
|
||||
)
|
||||
|
||||
func SetCloudOnly(ctx *cli.Context) {
|
||||
ctx.App.Metadata[contextKeyCloudOnly] = true
|
||||
}
|
||||
|
||||
func SetOssOnly(ctx *cli.Context) {
|
||||
ctx.App.Metadata[contextKeyOssOnly] = true
|
||||
}
|
||||
|
||||
func GetCloudOnly(ctx *cli.Context) bool {
|
||||
_, ok := ctx.App.Metadata[contextKeyCloudOnly].(bool)
|
||||
return ok
|
||||
}
|
||||
|
||||
func GetOssOnly(ctx *cli.Context) bool {
|
||||
_, ok := ctx.App.Metadata[contextKeyOssOnly].(bool)
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user