Skip to content

Commit

Permalink
go fmt update
Browse files Browse the repository at this point in the history
  • Loading branch information
spideyz0r committed Jul 19, 2023
1 parent 8737494 commit 0c4e9bf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ import (

var (
getCmd = &cobra.Command{
Use: "get",
Use: "get",
Aliases: []string{"g", "current"},
Short: "Get current context or namespace",
Short: "Get current context or namespace",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Please specify a subcommand. Use --help for more details.")
},
}
namespaceGetCmd = &cobra.Command{
Use: "namespace",
Use: "namespace",
Aliases: []string{"ns", "namespaces"},
Short: "get namespace",
Short: "get namespace",
Run: func(cmd *cobra.Command, args []string) {
debug, _ := cmd.Flags().GetBool("debug")
common.SetDebug(debug)
fmt.Printf("%s\n", common.GetCurrent("namespace"))
},
}
contextGetCmd = &cobra.Command{
Use: "context",
Use: "context",
Aliases: []string{"ctx", "contexts"},
Short: "get a context",
Short: "get a context",
Run: func(cmd *cobra.Command, args []string) {
debug, _ := cmd.Flags().GetBool("debug")
common.SetDebug(debug)
Expand Down
12 changes: 6 additions & 6 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ import (

var (
listCmd = &cobra.Command{
Use: "list",
Use: "list",
Aliases: []string{"l", "ls"},
Short: "List all contexts or namespaces",
Short: "List all contexts or namespaces",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Please specify a subcommand. Use --help for more details.")

},
}
namespaceListCmd = &cobra.Command{
Use: "namespace",
Use: "namespace",
Aliases: []string{"ns", "namespaces"},
Short: "list namespace",
Short: "list namespace",
Run: func(cmd *cobra.Command, args []string) {
debug, _ := cmd.Flags().GetBool("debug")
common.SetDebug(debug)
common.ListNamespaces()
},
}
contextListCmd = &cobra.Command{
Use: "context",
Use: "context",
Aliases: []string{"ctx", "contexts"},
Short: "list a context",
Short: "list a context",
Run: func(cmd *cobra.Command, args []string) {
debug, _ := cmd.Flags().GetBool("debug")
common.SetDebug(debug)
Expand Down
12 changes: 6 additions & 6 deletions cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import (
var (
debug = false
setCmd = &cobra.Command{
Use: "set",
Use: "set",
Aliases: []string{"s", "switch"},
Short: "Set context or namespace",
Short: "Set context or namespace",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Please specify a subcommand. Use --help for more details.")
},
}
namespaceSetCmd = &cobra.Command{
Use: "namespace",
Use: "namespace",
Aliases: []string{"ns", "namespaces"},
Short: "set namespace",
Short: "set namespace",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
fmt.Println("Please specify a single namespace")
Expand All @@ -39,9 +39,9 @@ var (
},
}
contextSetCmd = &cobra.Command{
Use: "context",
Use: "context",
Aliases: []string{"ctx", "contexts"},
Short: "set a context",
Short: "set a context",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
fmt.Println("Please specify a single context")
Expand Down

0 comments on commit 0c4e9bf

Please sign in to comment.