fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a9618477e
master
1function __fish_k3d_no_subcommand --description'Test if k3d has yet to be given subcommands' 2for iin ( commandline -xpc) 3if contains --$i cluster image kubeconfig node version 4return 1 5end 6end 7return 0 8end 9 10function __fish_k3d_print_clusters --description'Print a list of k3d clusters' 11k3d cluster list --no-headers| awk '{print $1}' 12end 13 14function __fish_k3d_print_nodes --description'Print a list of k3d nodes' 15k3d node list --no-headers| awk '{print $1}' 16end 17 18complete -f -c k3d -n __fish_k3d_no_subcommand -s h -l help -d"More information about a command" 19complete -f -c k3d -n __fish_k3d_no_subcommand -l version -d"Show k3d and default k3s version" 20complete -f -c k3d -n __fish_k3d_no_subcommand -a cluster -d"Manage cluster(s)" 21complete -f -c k3d -n __fish_k3d_no_subcommand -a version -d"Show k3d and default k3s version" 22complete -f -c k3d -n __fish_k3d_no_subcommand -a image -d"Handle container images" 23complete -f -c k3d -n __fish_k3d_no_subcommand -a kubeconfig -d"Manage kubeconfig(s)" 24complete -f -c k3d -n __fish_k3d_no_subcommand -a node -d"Manage node(s)" 25 26complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -a create -d"Create a new cluster" 27complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -a list -d"List cluster(s)" 28complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -a delete -d"Delete cluster(s)" 29complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -a start -d"Start existing k3d cluster(s)" 30complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -a stop -d"Stop existing k3d cluster(s)" 31complete -f -c k3d -n'__fish_seen_subcommand_from cluster; and __fish_seen_subcommand_from delete start stop' -a'(__fish_k3d_print_clusters)' -d Cluster 32complete -f -c k3d -n'__fish_seen_subcommand_from cluster' -s h -l help -d"Print usage" 33 34complete -f -c k3d -n'__fish_seen_subcommand_from image' -a import -d"Import image(s) from docker into k3d cluster(s)" 35complete -f -c k3d -n'__fish_seen_subcommand_from image' -a help -d"Print usage" 36complete -f -c k3d -n'__fish_seen_subcommand_from image' -s h -l help -d"Print usage" 37 38complete -f -c k3d -n'__fish_seen_subcommand_from kubeconfig' -a get -d"Get kubeconfig from cluster(s)" 39complete -f -c k3d -n'__fish_seen_subcommand_from kubeconfig' -a merge -d"Merge/write kubeconfig(s) from cluster(s) into existing kubeconfig/file" 40complete -f -c k3d -n'__fish_seen_subcommand_from kubeconfig get merge' -a'(__fish_k3d_print_clusters)' -d Cluster 41complete -f -c k3d -n'__fish_seen_subcommand_from kubeconfig get merge' -s a -l all -d"Get kubeconfig from all existing clusters" 42complete -f -c k3d -n'__fish_seen_subcommand_from kubeconfig' -s h -l help -d"Print usage" 43 44complete -f -c k3d -n'__fish_seen_subcommand_from node' -a create -d"Create a new k3s node in docker" 45complete -f -c k3d -n'__fish_seen_subcommand_from node' -a delete -d"Delete node(s)" 46complete -f -c k3d -n'__fish_seen_subcommand_from node' -a list -d"List node(s)" 47complete -f -c k3d -n'__fish_seen_subcommand_from node' -a start -d"Start an existing k3d node" 48complete -f -c k3d -n'__fish_seen_subcommand_from node' -a stop -d"Stop an existing k3d node" 49complete -f -c k3d -n'__fish_seen_subcommand_from node; and __fish_seen_subcommand_from delete start stop' -a'(__fish_k3d_print_nodes)' -d Node 50complete -f -c k3d -n'__fish_seen_subcommand_from node' -s h -l help -d"Print usage"