Skip to content

Commit 9741f69

Browse files
committed
update
1 parent 7b808d2 commit 9741f69

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ export TERMINAL_ID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -
1111

1212
## Binary
1313

14-
Go to the [releases](https://github.com/sbueringer/kubectx/releases) page and download the Linux or Windows version. Put the binary to somewhere you want (on UNIX-ish systems, /usr/local/bin or the like). Make sure it has execution bit set. If you want, you can add symlinks to `kcfg`, `kctx` and kns, e.g.:
14+
Go to the [releases](https://github.com/sbueringer/kubectx/releases) page and download the Linux or Windows version. Put the binary to somewhere you want (on UNIX-ish systems, /usr/local/bin or the like). Make sure it has execution bit set. If you want, you can shortcuts to `kcfg`, `kctx` and `kns`, e.g.:
1515

1616
````
17-
# kcfg = kubectx confg
18-
ln -s /usr/local/bin/kubectx /usr/local/bin/kcfg
19-
# kctx = kubectx context
20-
ln -s /usr/local/bin/kubectx /usr/local/bin/kctx
21-
# kns = kubectx namespace
22-
ln -s /usr/local/bin/kubectx /usr/local/bin/kns
17+
function kcfg() { kubectx config "$@" }
18+
function kctx() { kubectx context "$@" }
19+
function kns() { kubectx namespace "$@" }
2320
````
2421
## Auto completion
2522

cmd/root.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ var rootCmd = &cobra.Command{
5555
Long: `kubectx manages kubectl context incl. kubeconfig, context and namespace`,
5656
ValidArgs: []string{"config", "context", "namespace"} ,
5757
Run: func(cmd *cobra.Command, args []string) {
58-
59-
binName := os.Args[0]
60-
61-
if binName == "kcfg" {
62-
configCmd.Run(cmd, args)
63-
return
64-
} else if binName == "kctx" {
65-
contextCmd.Run(cmd, args)
66-
return
67-
} else if binName == "kns" {
68-
namespaceCmd.Run(cmd, args)
69-
return
70-
}
7158
cmd.Help()
7259
},
7360
}

0 commit comments

Comments
 (0)