This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash_setup() { | |
cat <<SETUP | |
alias kctx='. $(readlink -f "$0")' | |
__kctx () { mapfile -t COMPREPLY < <(compgen -W "\$(kubectl config get-contexts -o name) --help --unset" -- "\${COMP_WORDS[1]}"); } | |
complete -F __kctx kctx | |
SETUP | |
} | |
usage() { | |
cat <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cache=${XDG_CACHE_HOME:-$HOME/.cache}/kubectl-v | |
errors="$cache/errors-$$" | |
mkdir -p "$cache" | |
[[ $1 = "v" ]] && shift # Avoid recursive calls | |
get_sys() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'redcarpet' | |
require 'erb' | |
input = ARGV[0] && ARGV[0] != "-" && File.open(ARGV[0]) || STDIN | |
output = ARGV[1] && File.open(ARGV[1], "w") || STDOUT | |
File.join(ENV["XDG_CACHE_HOME"] || "#{ENV['HOME']}/.cache", "gfm-render") | |
class RenderWithTaskLists < Redcarpet::Render::HTML |