From 2f2b78d619a302bf610e9bc0faeff4425e2f0bcc Mon Sep 17 00:00:00 2001 From: AngeD Date: Wed, 9 Nov 2022 12:14:39 +0100 Subject: [PATCH 1/2] fix: README formatting --- README.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ccbfe7f..04c3e70 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Add the following to your `.bashrc/.zshrc` file: `.zshrc` file: ```sh -function kubectl() { echo "+ kubectl $@">&2; command kubectl $@; } +function kubectl() { echo "+ kubectl $@" >&2; command kubectl $@; } ``` #### Fish @@ -83,31 +83,35 @@ instead of aliases, so that pressing space shows the full command before executi ### Syntax explanation -* **`k`**=`kubectl` - * **`sys`**=`--namespace kube-system` +* **`k`**: `kubectl` + * **`sys`**: `--namespace kube-system` * commands: - * **`g`**=`get` - * **`d`**=`describe` - * **`rm`**=`delete` - * **`a`**:`apply -f` - * **`ak`**:`apply -k` - * **`k`**:`kustomize` + * **`g`**: `get` + * **`d`**: `describe` + * **`rm`**: `delete` + * **`a`**: `apply -f` + * **`ak`**: `apply -k` + * **`k`**: `kustomize` * **`ex`**: `exec -i -t` * **`lo`**: `logs -f` -* resources: - * **`po`**=pod, **`dep`**=`deployment`, **`ing`**=`ingress`, - **`svc`**=`service`, **`cm`**=`configmap`, **`sec`**=`secret`, - **`ns`**=`namespace`, **`no`**=`node` - **:warning: Please do not suggest new resources here, instead fork the project.** +* resources: **:warning: Please do not suggest new resources here, instead fork the project.** + * **`po`**: `pod` + * **`dep`**: `deployment` + * **`ing`**: `ingress` + * **`svc`**: `service` + * **`cm`**: `configmap` + * **`sec`**: `secret` + * **`ns`**: `namespace` + * **`no`**: `node` * flags: * output format: **`oyaml`**, **`ojson`**, **`owide`** * **`all`**: `--all` or `--all-namespaces` depending on the command * **`sl`**: `--show-labels` - * **`w`**=`-w/--watch` + * **`w`**: `-w/--watch` * value flags (should be at the end): - * **`n`**=`-n/--namespace` - * **`f`**=`-f/--filename` - * **`l`**=`-l/--selector` + * **`n`**: `-n/--namespace` + * **`f`**: `-f/--filename` + * **`l`**: `-l/--selector` ### Running the script @@ -125,7 +129,7 @@ python generate_aliases.py fish > .kubectl_aliases.fish - **Doesn't this slow down my shell start up?** Sourcing the file that contains ~500 aliases takes about 30-45 milliseconds in my shell (zsh). I don't think -it's a big deal for me. Measure it with `echo $(($(date +%s%N)/1000000))` +it's a big deal for me. Measure it with `echo $(($(date '+%s%N') / 1000000))` command yourself in your .bashrc/.zshrc. - **Can I add more Kubernetes resource types to this?** Please consider forking From fd84ad4d2254b3b14004fa1a84d5b18f8d68169e Mon Sep 17 00:00:00 2001 From: AngeD Date: Wed, 9 Nov 2022 12:15:36 +0100 Subject: [PATCH 2/2] fix: ahmetb/kubectl-aliases#53 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 04c3e70..30bf952 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Add the following to your `.bashrc/.zshrc` file: `.zshrc` file: ```sh -function kubectl() { echo "+ kubectl $@" >&2; command kubectl $@; } +function kubectl() { echo "+ kubectl $@" >&2; command kubectl "$@"; } ``` #### Fish