{"modulePath":"github.com/CubePathInc/cubecli","version":"v1.23.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmdutil\n\n## Constants\n\n```go\nconst (\n\tClientKey        contextKey = \"api-client\"\n\tActiveProfileKey contextKey = \"active-profile\"\n)\n```\n\n## Functions\n\n```go\nfunc CheckForce(cmd *cobra.Command, msg string) bool\n```\n\n```go\nfunc ConfirmAction(msg string) bool\n```\n\n```go\nfunc ConfirmDefaultYes(msg string) bool\n```\nConfirmDefaultYes asks a yes/no question where Enter means yes.\n\n```go\nfunc GetActiveProfileName(cmd *cobra.Command) string\n```\n\n```go\nfunc GetClient(cmd *cobra.Command) *api.Client\n```\n\n```go\nfunc IsJSON(cmd *cobra.Command) bool\n```\n\n```go\nfunc MoveProjectCmd(argName, noun string, path PathFunc) *cobra.Command\n```\nMoveProjectCmd builds \\`move-project \\\u003carg\u003e --project N\\`, which posts {\"project\\_id\": N} to path(arg).\n\n```go\nfunc ProtectionCmd(argName, noun string, path PathFunc) *cobra.Command\n```\nProtectionCmd builds \\`protection \\\u003carg\u003e --enable|--disable\\`, which posts {\"enabled\": bool} to path(arg). Protection blocks deletion of the resource.\n\n```go\nfunc ReadJSONFile(path string, v interface{}) error\n```\nReadJSONFile decodes a JSON document from path, or from stdin when path is \"-\".\n\n```go\nfunc RunDetail(cmd *cobra.Command, spin, fallback string, call func() (json.RawMessage, error)) error\n```\nRunDetail runs one request behind a spinner and prints the API's \"detail\" message (fallback when there is none), or the raw response with --json.\n\n```go\nfunc StdinIsTerminal() bool\n```\nStdinIsTerminal reports whether stdin is interactive.\n\n```go\nfunc YesNo(b bool) string\n```\nYesNo renders a bool for tables.\n\n## Types\n\n```go\ntype PathFunc func(arg string) (string, error)\n```\nPathFunc turns the command's positional argument into an API path.\n\n```go\nfunc IntPath(format, argName string) PathFunc\n```\nIntPath returns a PathFunc for routes keyed by a numeric id, e.g. \"/vps/%d/protection\".\n\n```go\nfunc StringPath(format string) PathFunc\n```\nStringPath returns a PathFunc for routes keyed by a uuid or name, e.g. \"/loadbalancer/%s/protection\".\n\n","path":"github.com/CubePathInc/cubecli/internal/cmdutil","name":"cmdutil","synopsis":"","isRedistributable":true}
