diff --git a/README.md b/README.md index 7f727f1..df6a971 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,12 @@ export TERMINAL_ID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head - ## Binary -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.: +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.: ```` -# kcfg = kubectx confg -ln -s /usr/local/bin/kubectx /usr/local/bin/kcfg -# kctx = kubectx context -ln -s /usr/local/bin/kubectx /usr/local/bin/kctx -# kns = kubectx namespace -ln -s /usr/local/bin/kubectx /usr/local/bin/kns +function kcfg() { kubectx config "$@" } +function kctx() { kubectx context "$@" } +function kns() { kubectx namespace "$@" } ```` ## Auto completion diff --git a/cmd/root.go b/cmd/root.go index 3e61af5..e9b1342 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -55,19 +55,6 @@ var rootCmd = &cobra.Command{ Long: `kubectx manages kubectl context incl. kubeconfig, context and namespace`, ValidArgs: []string{"config", "context", "namespace"} , Run: func(cmd *cobra.Command, args []string) { - - binName := os.Args[0] - - if binName == "kcfg" { - configCmd.Run(cmd, args) - return - } else if binName == "kctx" { - contextCmd.Run(cmd, args) - return - } else if binName == "kns" { - namespaceCmd.Run(cmd, args) - return - } cmd.Help() }, }