From 7bb7ce62d3a78859aa15151ecc46df5adc9cf049 Mon Sep 17 00:00:00 2001 From: Francisco Zuviría Date: Sun, 22 Apr 2018 22:34:26 -0300 Subject: On branch fzuviria.plugin.dirhistory.new-feature.navigate-history Changes to be committed: modified: dirhistory/dirhistory.plugin.zsh New Feature: Navigate directory hierarchy using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented) ALT-UP moves to higher hierarchy (cd ..) ALT-DOWN moves into the first directory found in alphabetical order --- plugins/dirhistory/dirhistory.plugin.zsh | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'plugins') diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8138872bc..05839e35a 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -2,6 +2,10 @@ # Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories # that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. # +# Navigate directory hierarchy using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented) +# ALT-UP moves to higher hierarchy (cd ..) +# ALT-DOWN moves into the first directory found in alphabetical order +# dirhistory_past=($PWD) dirhistory_future=() @@ -134,3 +138,49 @@ bindkey "\e\e[C" dirhistory_zle_dirhistory_future bindkey "\eO3C" dirhistory_zle_dirhistory_future +# +# HIERARCHY Implemented in this section, in case someone wants to split it to another plugin if it clashes bindings +# + +# Move up in hierarchy +function dirhistory_up() { + cd .. +} + +# Move down in hierarchy +function dirhistory_down() { + cd "`find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1`" +} + + +# Bind keys to hierarchy navigation +function dirhistory_zle_dirhistory_up() { + zle kill-buffer # Erase current line in buffer + dirhistory_up + zle accept-line +} + +function dirhistory_zle_dirhistory_down() { + zle kill-buffer # Erase current line in buffer + dirhistory_down + zle accept-line +} + +zle -N dirhistory_zle_dirhistory_up +# xterm in normal mode +bindkey "\e[3A" dirhistory_zle_dirhistory_up +bindkey "\e[1;3A" dirhistory_zle_dirhistory_up +# Mac teminal (alt+up) + #bindkey "^[?" dirhistory_zle_dirhistory_up #dont know it +# Putty: +bindkey "\e\e[A" dirhistory_zle_dirhistory_up +# GNU screen: +bindkey "\eO3A" dirhistory_zle_dirhistory_up + +zle -N dirhistory_zle_dirhistory_down +bindkey "\e[3B" dirhistory_zle_dirhistory_down +bindkey "\e[1;3B" dirhistory_zle_dirhistory_down +# Mac teminal (alt+down) + #bindkey "^[?" dirhistory_zle_dirhistory_down #dont know it +bindkey "\e\e[B" dirhistory_zle_dirhistory_down +bindkey "\eO3B" dirhistory_zle_dirhistory_down -- cgit v1.2.3-70-g09d2 From 8eba19208dfd62a0565e837a715e62d9876480a0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 27 Apr 2018 17:56:21 +0200 Subject: Revert to checking if `enable-ssh-support` is set Fixes #6772 --- plugins/gpg-agent/gpg-agent.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh index 6a94f598f..3e24c2527 100644 --- a/plugins/gpg-agent/gpg-agent.plugin.zsh +++ b/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -1,16 +1,16 @@ # Enable gpg-agent if it is not running- # --use-standard-socket will work from version 2 upwards -AGENT_SOCK=`gpgconf --list-dirs | grep agent-socket | cut -d : -f 2` +AGENT_SOCK=$(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2) -if [ ! -S ${AGENT_SOCK} ]; then - gpg-agent --daemon --use-standard-socket >/dev/null 2>&1 +if [[ ! -S $AGENT_SOCK ]]; then + gpg-agent --daemon --use-standard-socket &>/dev/null fi -export GPG_TTY=$(tty) +export GPG_TTY=$TTY # Set SSH to use gpg-agent if it's enabled -if [ -S "${AGENT_SOCK}.ssh" ]; then - export SSH_AUTH_SOCK="${AGENT_SOCK}.ssh" +GNUPGCONFIG="${GNUPGHOME:-"$HOME/.gnupg"}/gpg-agent.conf" +if [[ -r $GNUPGCONFIG ]] && command grep -q enable-ssh-support "$GNUPGCONFIG"; then + export SSH_AUTH_SOCK="$AGENT_SOCK.ssh" unset SSH_AGENT_PID fi - -- cgit v1.2.3-70-g09d2 From 32952ec7e8fc254e892eb1c32191d0c1901ae811 Mon Sep 17 00:00:00 2001 From: Ady Romantika Date: Sat, 28 Apr 2018 22:55:46 +0800 Subject: Add aliases for kubectl ingress (#6762) --- plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 97e429aac..ec1321d8b 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -33,6 +33,12 @@ alias kes='k edit svc' alias kds='k describe svc' alias kdels='k delete svc' +# Ingress management +alias kgi='k get ingress' +alias kei='k edit ingress' +alias kdi='k describe ingress' +alias kdeli='k delete ingress' + # Secret management alias kgsec='k get secret' alias kdsec='k describe secret' -- cgit v1.2.3-70-g09d2 From 493c30954bae3da4ccd80333b807a8d37c131da8 Mon Sep 17 00:00:00 2001 From: Oliver Baumann Date: Mon, 30 Apr 2018 16:25:02 +0200 Subject: Parse branch-name for fresh repo (#6302) Inside a fresh git repo, i.e. immediately after a `git init`, usually no commit template exists yet. In this case, git renders a different status message than "Initial commit on". We should consider this message when attempting to parse out the branch name. Fixes #6301 --- plugins/git-prompt/gitstatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index a8eb8284b..14d875973 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -41,7 +41,7 @@ ahead, behind = 0, 0 status = [(line[0], line[1], line[2:]) for line in stdout.decode('utf-8').splitlines()] for st in status: if st[0] == '#' and st[1] == '#': - if re.search('Initial commit on', st[2]): + if re.search('Initial commit on', st[2]) or re.search('No commits yet on', st[2]): branch = st[2].split(' ')[-1] elif re.search('no branch', st[2]): # detached status branch = get_tagname_or_hash() -- cgit v1.2.3-70-g09d2 From cafa657469bda1baf145c090e168057ae632464d Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Tue, 1 May 2018 06:21:12 -0700 Subject: Correctly handle verbose/version flags for rustc (#6786) See the help output for rustc (v1.25) --- plugins/rust/_rust | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/rust/_rust b/plugins/rust/_rust index ac6aee160..6e3f344cd 100644 --- a/plugins/rust/_rust +++ b/plugins/rust/_rust @@ -88,14 +88,14 @@ _rustc_opts_vals=( --pretty='[Pretty-print the input instead of compiling]::TYPE:_values "TYPES" "$_rustc_pretty_types[@]"' --unpretty='[Present the input source, unstable (and less-pretty)]::TYPE:_values "TYPES" "$_rustc_unpretty_types[@]"' --color='[Configure coloring of output]:CONF:_values "COLORS" "$_rustc_color_types[@]"' - {-v,--version}'[Print version info and exit]::VERBOSE:(verbose)' ) _rustc_opts_switches=( -g'[Equivalent to --debuginfo=2]' -O'[Equivalent to --opt-level=2]' --test'[Build a test harness]' - --verbose'[Use verbose output]' + {-v,--verbose}'[Use verbose output]' + {-V,--version}'[Print version info and exit]' {-h,--help}'[Display this message]' --no-analysis'[Parse and expand the output, but run no analysis or produce output]' --no-trans'[Run all passes except translation; no output]' -- cgit v1.2.3-70-g09d2 From 00f311a3c1c0beff04db8a005fcfbfc251d62276 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 7 May 2018 18:00:27 +0200 Subject: Add READMEs to plugins copydir and copyfile (#6802) * Add README to copydir plugin * Add README to copyfile plugin --- plugins/copydir/README.md | 10 ++++++++++ plugins/copyfile/README.md | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 plugins/copydir/README.md create mode 100644 plugins/copyfile/README.md (limited to 'plugins') diff --git a/plugins/copydir/README.md b/plugins/copydir/README.md new file mode 100644 index 000000000..594bf1065 --- /dev/null +++ b/plugins/copydir/README.md @@ -0,0 +1,10 @@ +# copydir plugin + +Copies the path of your current folder to the system clipboard. + +To use, add `copydir` to your plugins array: +``` +plugins=(... copydir) +``` + +Then use the command `copydir` to copy the $PWD. diff --git a/plugins/copyfile/README.md b/plugins/copyfile/README.md new file mode 100644 index 000000000..53138ad06 --- /dev/null +++ b/plugins/copyfile/README.md @@ -0,0 +1,10 @@ +# copyfile plugin + +Puts the contents of a file in your system clipboard so you can paste it anywhere. + +To use, add `copyfile` to your plugins array: +``` +plugins=(... copyfile) +``` + +Then you can run the command `copyfile ` to copy the file named `filename`. -- cgit v1.2.3-70-g09d2 From 0011d34f71fca91a2afeca7a0c05942c7e63ee5f Mon Sep 17 00:00:00 2001 From: MikeDawg Date: Sat, 3 Feb 2018 16:40:05 -0700 Subject: Removed duplicate fedora from plugins, dnf provides exact same features --- plugins/fedora/README.md | 3 --- plugins/fedora/fedora.plugin.zsh | 17 +---------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 plugins/fedora/README.md mode change 100644 => 120000 plugins/fedora/fedora.plugin.zsh (limited to 'plugins') diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md deleted file mode 100644 index f384b0ffd..000000000 --- a/plugins/fedora/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This is a plugin based on yum plugin, but using dnf as main frontend -(from Fedora 22 onwards, yum is deprecated in favor of dnf). - diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh deleted file mode 100644 index eddc3627b..000000000 --- a/plugins/fedora/fedora.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -## Aliases - -alias dnfs="dnf search" # search package -alias dnfp="dnf info" # show package info -alias dnfl="dnf list" # list packages -alias dnfgl="dnf grouplist" # list package groups -alias dnfli="dnf list installed" # print all installed packages -alias dnfmc="dnf makecache" # rebuilds the dnf package list - -alias dnfu="sudo dnf upgrade" # upgrade packages -alias dnfi="sudo dnf install" # install package -alias dnfgi="sudo dnf groupinstall" # install package group -alias dnfr="sudo dnf remove" # remove package -alias dnfgr="sudo dnf groupremove" # remove pagage group -alias dnfrl="sudo dnf remove --remove-leaves" # remove package and leaves -alias dnfc="sudo dnf clean all" # clean cache diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh new file mode 120000 index 000000000..16a214313 --- /dev/null +++ b/plugins/fedora/fedora.plugin.zsh @@ -0,0 +1 @@ +../dnf/dnf.plugin.zsh \ No newline at end of file -- cgit v1.2.3-70-g09d2 From b7e544e6f171e3bf754d80e3c5b61b4f8f065622 Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Tue, 8 May 2018 12:13:11 +0100 Subject: gradle plugin should support kotlin gradle build files (#6529) This change allows the gradle plugin to recongise build.gradle.kts files and thus generate the autocomplete entries. -=david=- closes #6528 --- plugins/gradle/gradle.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index 0adc04a13..c7047552d 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -88,7 +88,7 @@ function _gradle_arguments() { # and if so, regenerate the .gradle_tasks cache file ############################################################################ _gradle_does_task_list_need_generating () { - [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache ]] + [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache || build.gradle.kts -nt .gradletasknamecache ]] } ############## @@ -144,7 +144,7 @@ _gradle_parse_and_extract_tasks () { # Discover the gradle tasks by running "gradle tasks --all" ############################################################################ _gradle_tasks () { - if [[ -f build.gradle ]]; then + if [[ -f build.gradle || -f build.gradle.kts ]]; then _gradle_arguments if _gradle_does_task_list_need_generating; then _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache @@ -154,7 +154,7 @@ _gradle_tasks () { } _gradlew_tasks () { - if [[ -f build.gradle ]]; then + if [[ -f build.gradle || -f build.gradle.kts ]]; then _gradle_arguments if _gradle_does_task_list_need_generating; then _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache -- cgit v1.2.3-70-g09d2 From 18f7ca577a41807f0c99fc9d00e1572d96d7c6cb Mon Sep 17 00:00:00 2001 From: Francisco Zuviría Date: Tue, 8 May 2018 12:55:59 -0300 Subject: Adhere to coding style outlined in wiki --- plugins/dirhistory/dirhistory.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 05839e35a..6867086ca 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -144,12 +144,12 @@ bindkey "\eO3C" dirhistory_zle_dirhistory_future # Move up in hierarchy function dirhistory_up() { - cd .. + cd .. || return 1 } # Move down in hierarchy function dirhistory_down() { - cd "`find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1`" + cd "$(find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1)" || return 1 } -- cgit v1.2.3-70-g09d2 From 825baeb31074ee43e77e7cd26ff17b619ed13bb5 Mon Sep 17 00:00:00 2001 From: Quentin Nerden Date: Wed, 9 May 2018 22:34:41 +0200 Subject: Add autocomplete plugin for minikube (#6436) --- plugins/minikube/minikube.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/minikube/minikube.plugin.zsh (limited to 'plugins') diff --git a/plugins/minikube/minikube.plugin.zsh b/plugins/minikube/minikube.plugin.zsh new file mode 100644 index 000000000..d8ebe79af --- /dev/null +++ b/plugins/minikube/minikube.plugin.zsh @@ -0,0 +1,6 @@ +# Autocompletion for Minikube. +# + +if [ $commands[minikube] ]; then + source <(minikube completion zsh) +fi -- cgit v1.2.3-70-g09d2 From e8c328cb394e39f8d1c7d18b85b0be12bd71c556 Mon Sep 17 00:00:00 2001 From: Hosh Date: Thu, 10 May 2018 19:53:16 +0100 Subject: Update AWS completion (#6745) --- plugins/aws/aws.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 6a0e04add..a326e2e01 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -42,11 +42,11 @@ function aws_profiles { compctl -K aws_profiles asp -if _homebrew-installed && _awscli-homebrew-installed ; then +if which aws_zsh_completer.sh &>/dev/null; then + _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null) +elif _homebrew-installed && _awscli-homebrew-installed; then _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh -else - _aws_zsh_completer_path=$(which aws_zsh_completer.sh) fi -[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path +[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path unset _aws_zsh_completer_path -- cgit v1.2.3-70-g09d2 From 18effd77db1156c11848bd3bfadd8fa63c747516 Mon Sep 17 00:00:00 2001 From: Xiao Fan Date: Fri, 11 May 2018 07:28:02 -0700 Subject: last-working-dir: disable chpwd_last_working_dir in subshells (#6817) --- plugins/last-working-dir/last-working-dir.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index e882b288f..53bb19e46 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -4,8 +4,10 @@ typeset -g ZSH_LAST_WORKING_DIRECTORY # Updates the last directory once directory is changed chpwd_functions+=(chpwd_last_working_dir) chpwd_last_working_dir() { - local cache_file="$ZSH_CACHE_DIR/last-working-dir" - pwd >| "$cache_file" + if [ "$ZSH_SUBSHELL" = 0 ]; then + local cache_file="$ZSH_CACHE_DIR/last-working-dir" + pwd >| "$cache_file" + fi } # Changes directory to the last working directory -- cgit v1.2.3-70-g09d2 From 8ebf2a678507b28cf107858b316f5e874ef73d0f Mon Sep 17 00:00:00 2001 From: Giuseppe Landolfi Date: Sun, 13 May 2018 01:53:45 +0200 Subject: Fine-tune dirhistory plugin mappings for Mac (#6580) See https://github.com/robbyrussell/oh-my-zsh/pull/6533#issuecomment-360878060 --- plugins/dirhistory/dirhistory.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8138872bc..283dace29 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -120,7 +120,9 @@ zle -N dirhistory_zle_dirhistory_back bindkey "\e[3D" dirhistory_zle_dirhistory_back bindkey "\e[1;3D" dirhistory_zle_dirhistory_back # Mac teminal (alt+left/right) -bindkey "^[b" dirhistory_zle_dirhistory_back +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + bindkey "^[b" dirhistory_zle_dirhistory_back +fi # Putty: bindkey "\e\e[D" dirhistory_zle_dirhistory_back # GNU screen: @@ -129,7 +131,9 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back zle -N dirhistory_zle_dirhistory_future bindkey "\e[3C" dirhistory_zle_dirhistory_future bindkey "\e[1;3C" dirhistory_zle_dirhistory_future -bindkey "^[f" dirhistory_zle_dirhistory_future +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + bindkey "^[f" dirhistory_zle_dirhistory_future +fi bindkey "\e\e[C" dirhistory_zle_dirhistory_future bindkey "\eO3C" dirhistory_zle_dirhistory_future -- cgit v1.2.3-70-g09d2 From 0c63909ad3e8ed73d2b732396f2fd8ffffcf1b89 Mon Sep 17 00:00:00 2001 From: Ian Chesal Date: Sun, 13 May 2018 12:56:46 -0700 Subject: Fix default location of the virtualenvwrapper script (#6348) The `virtualenvwrapper` script has been relocated to `/usr/local/bin/virtualenvwrapper.sh`. Update the plugin to look in the new location first. See: http://virtualenvwrapper.readthedocs.io/en/latest/#introduction to confirm the change in location for this script. This addresses issue #3047 where the solution was to source this file from your zshrc. --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins') diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 6cd30732e..484f18c91 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -6,6 +6,13 @@ if (( $+commands[$virtualenvwrapper] )); then unsetopt equals source ${${virtualenvwrapper}:c} } +elif [[ -f "/usr/local/bin/virtualenvwrapper.sh" ]]; then + function { + setopt local_options + unsetopt equals + virtualenvwrapper="/usr/local/bin/virtualenvwrapper.sh" + source "/usr/local/bin/virtualenvwrapper.sh" + } elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then function { setopt local_options -- cgit v1.2.3-70-g09d2 From 919f0a42a09371c948d89c2d63593c23658811cc Mon Sep 17 00:00:00 2001 From: Quentin Nerden Date: Sun, 13 May 2018 21:58:35 +0200 Subject: Updated autocomplete and readme (#6720) Signed-off-by: Troy Fontaine --- plugins/docker/_docker | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 0c20cf28e..4d1b79a82 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -450,9 +450,9 @@ __docker_complete_events_filter() { ;; (event) local -a event_opts - event_opts=('attach' 'commit' 'connect' 'copy' 'create' 'delete' 'destroy' 'detach' 'die' 'disconnect' 'exec_create' 'exec_detach' - 'exec_start' 'export' 'health_status' 'import' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'rename' 'resize' 'restart' 'save' 'start' - 'stop' 'tag' 'top' 'unmount' 'unpause' 'untag' 'update') + event_opts=('attach' 'commit' 'connect' 'copy' 'create' 'delete' 'destroy' 'detach' 'die' 'disable' 'disconnect' 'enable' 'exec_create' 'exec_detach' + 'exec_start' 'export' 'health_status' 'import' 'install' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'remove' 'rename' 'resize' + 'restart' 'save' 'start' 'stop' 'tag' 'top' 'unmount' 'unpause' 'untag' 'update') _describe -t event-filter-opts "event filter options" event_opts && ret=0 ;; (image) @@ -3024,4 +3024,4 @@ _docker "$@" # indent-tabs-mode: nil # sh-basic-offset: 4 # End: -# vim: ft=zsh sw=4 ts=4 et \ No newline at end of file +# vim: ft=zsh sw=4 ts=4 et -- cgit v1.2.3-70-g09d2 From 0608bb768fea1222410c5bd9b576bb1098409ffa Mon Sep 17 00:00:00 2001 From: Harald Nordgren Date: Mon, 14 May 2018 15:09:57 +0200 Subject: Use 'apt' instead of 'apt-get' for Ubuntu >=16.04 (#5787) --- plugins/ubuntu/ubuntu.plugin.zsh | 67 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'plugins') diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 082481466..f7363feb8 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -5,18 +5,21 @@ # https://github.com/trinaldi # Nicolas Jonas nextgenthemes.com # https://github.com/loctauxphilippe +# https://github.com/HaraldNordgren # # Debian, Ubuntu and friends related zsh aliases and functions for zsh +(( $+commands[apt] )) && APT=apt || APT=apt-get + alias acs='apt-cache search' compdef _acs acs='apt-cache search' alias afs='apt-file search --regexp' compdef _afs afs='apt-file search --regexp' -# These are apt-get only -alias ags='apt-get source' # asrc -compdef _ags ags='apt-get source' +# These are apt/apt-get only +alias ags="$APT source" # asrc +compdef _ags ags="$APT source" alias acp='apt-cache policy' # app compdef _acp acp='apt-cache policy' @@ -37,33 +40,33 @@ compdef _afu afu='sudo apt-file update' alias ppap='sudo ppa-purge' compdef _ppap ppap='sudo ppa-purge' -alias apg='sudo apt-get' # age - but without sudo -alias aga='sudo apt-get autoclean' # aac -alias agb='sudo apt-get build-dep' # abd -alias agc='sudo apt-get clean' # adc -alias agd='sudo apt-get dselect-upgrade' # ads -alias agi='sudo apt-get install' # ai -alias agp='sudo apt-get purge' # ap -alias agr='sudo apt-get remove' # ar -alias agu='sudo apt-get update' # ad -alias agud='sudo apt-get update && sudo apt-get full-upgrade' #adu -alias agug='sudo apt-get upgrade' # ag -alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg -alias agar='sudo apt-get autoremove' - -compdef _ag apg='sudo apt-get' -compdef _aga aga='sudo apt-get autoclean' -compdef _agb agb='sudo apt-get build-dep' -compdef _agc agc='sudo apt-get clean' -compdef _agd agd='sudo apt-get dselect-upgrade' -compdef _agi agi='sudo apt-get install' -compdef _agp agp='sudo apt-get purge' -compdef _agr agr='sudo apt-get remove' -compdef _agu agu='sudo apt-get update' -compdef _agud agud='sudo apt-get update && sudo apt-get full-upgrade' -compdef _agug agug='sudo apt-get upgrade' -compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade' -compdef _agar agar='sudo apt-get autoremove' +alias ag="sudo $APT" # age - but without sudo +alias aga="sudo $APT autoclean" # aac +alias agb="sudo $APT build-dep" # abd +alias agc="sudo $APT clean" # adc +alias agd="sudo $APT dselect-upgrade" # ads +alias agi="sudo $APT install" # ai +alias agp="sudo $APT purge" # ap +alias agr="sudo $APT remove" # ar +alias agu="sudo $APT update" # ad +alias agud="sudo $APT update && sudo $APT dist-upgrade" #adu +alias agug="sudo $APT upgrade" # ag +alias aguu="sudo $APT update && sudo $APT upgrade" #adg +alias agar="sudo $APT autoremove" + +compdef _ag ag="sudo $APT" +compdef _aga aga="sudo $APT autoclean" +compdef _agb agb="sudo $APT build-dep" +compdef _agc agc="sudo $APT clean" +compdef _agd agd="sudo $APT dselect-upgrade" +compdef _agi agi="sudo $APT install" +compdef _agp agp="sudo $APT purge" +compdef _agr agr="sudo $APT remove" +compdef _agu agu="sudo $APT update" +compdef _agud agud="sudo $APT update && sudo $APT dist-upgrade" +compdef _agug agug="sudo $APT upgrade" +compdef _aguu aguu="sudo $APT update && sudo $APT upgrade" +compdef _agar agar="sudo $APT autoremove" # Remove ALL kernel images and headers EXCEPT the one in use alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ @@ -91,8 +94,8 @@ aar() { PACKAGE=${1##*/} fi - sudo apt-add-repository $1 && sudo apt-get update - sudo apt-get install $PACKAGE + sudo apt-add-repository $1 && sudo $APT update + sudo $APT install $PACKAGE } # Prints apt history -- cgit v1.2.3-70-g09d2 From 6876d9c5438b0e0e950fc85f736458ba55f8d65c Mon Sep 17 00:00:00 2001 From: Varun Patro Date: Mon, 14 May 2018 19:30:04 +0530 Subject: Update fasd.plugin.zsh (#6822) If `EDITOR` variable contains arguments to an editor such as mine: `export EDITOR=emacsclient -t -c --alternate-editor=''` Then, the editor's arguments are passed on to `fasd`. To fix this, pass the EDITOR program in quotes. --- plugins/fasd/fasd.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index 2c302f74d..45d10858f 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -6,6 +6,6 @@ if [ $commands[fasd] ]; then # check if fasd is installed source "$fasd_cache" unset fasd_cache - alias v="f -e $EDITOR" + alias v="f -e \"$EDITOR\"" alias o='a -e open_command' fi -- cgit v1.2.3-70-g09d2 From 0aa645f8033ef86f8c8b0729a94fc54fbec49a25 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 15 May 2018 12:07:23 +0200 Subject: pyenv: search the pyenv command if not found (#6811) --- plugins/pyenv/pyenv.plugin.zsh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 76880e415..dbc7da472 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -1,7 +1,29 @@ # This plugin loads pyenv into the current shell and provides prompt info via # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available. -if (( $+commands[pyenv] )); then +FOUND_PYENV=$+commands[pyenv] + +if [[ $FOUND_PYENV -ne 1 ]]; then + pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv") + for dir in $pyenvdirs; do + if [[ -d $dir/bin ]]; then + export PATH="$PATH:$dir/bin" + FOUND_PYENV=1 + break + fi + done +fi + +if [[ $FOUND_PYENV -ne 1 ]]; then + if (( $+commands[brew] )) && dir=$(brew --prefix pyenv 2>/dev/null); then + if [[ -d $dir/bin ]]; then + export PATH="$PATH:$dir/bin" + FOUND_PYENV=1 + fi + fi +fi + +if [[ $FOUND_PYENV -eq 1 ]]; then eval "$(pyenv init - zsh)" if (( $+commands[pyenv-virtualenv-init] )); then eval "$(pyenv virtualenv-init - zsh)" @@ -15,3 +37,5 @@ else echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" } fi + +unset FOUND_PYENV dir -- cgit v1.2.3-70-g09d2 From c3493dc5ceb87a5c74d288f30fbe4bdbf4cb97c5 Mon Sep 17 00:00:00 2001 From: rco-ableton Date: Wed, 16 May 2018 17:40:42 +0200 Subject: Add Heroku pipelines support (#5660) --- plugins/heroku/_heroku | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'plugins') diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku index 878d3ce1b..f26595e00 100644 --- a/plugins/heroku/_heroku +++ b/plugins/heroku/_heroku @@ -45,6 +45,18 @@ _1st_arguments=( "logs\:drains":"manage syslog drains" "maintenance\:on":"put the app into maintenance mode" "maintenance\:off":"take the app out of maintenance mode" + "pipelines":"list pipelines you have access to" + "pipelines\:add":"add this app to a pipeline" + "pipelines\:create":"create a new pipeline" + "pipelines\:destroy":"destroy a pipeline" + "pipelines\:diff":"compares the latest release of this app to its downstream app(s)" + "pipelines\:info":"show list of apps in a pipeline" + "pipelines\:list":"list pipelines you have access to" + "pipelines\:open":"open a pipeline in dashboard" + "pipelines\:promote":"promote the latest release of this app to its downstream app(s)" + "pipelines\:remove":"remove this app from its pipeline" + "pipelines\:rename":"rename a pipeline" + "pipelines\:update":"update this app's stage in a pipeline" "pg\:credentials":"display the DATABASE credentials" "pg\:diagnose":"run diagnostics report on DATABASE" "pg\:info":"display database information" @@ -131,6 +143,41 @@ case "$words[1]" in '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ ) ;; + pipelines) + _command_args=( + '(--json)'--json'[output in json format]' \ + ) + ;; + pipelines:add) + _command_args=( + '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ + ) + ;; + pipelines:create) + _command_args=( + '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ + ) + ;; + pipelines:info) + _command_args=( + '(--json)'--json'[output in json format]' \ + ) + ;; + pipelines:list) + _command_args=( + '(--json)'--json'[output in json format]' \ + ) + ;; + pipelines:promote) + _command_args=( + '(-t|--to)'{-t,--to}'[comma separated list of apps to promote to]' \ + ) + ;; + pipelines:update) + _command_args=( + '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \ + ) + ;; pgbackups:capture) _command_args=( '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ -- cgit v1.2.3-70-g09d2 From de1e3c0794ab4214412fe4f15d1e39ddffcbea42 Mon Sep 17 00:00:00 2001 From: Julien Palmas Date: Mon, 22 Jun 2015 14:19:08 +0200 Subject: add pg:backups command --- plugins/heroku/_heroku | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku index f26595e00..4122de237 100644 --- a/plugins/heroku/_heroku +++ b/plugins/heroku/_heroku @@ -72,6 +72,7 @@ _1st_arguments=( "pg\:unfollow":"stop a replica from following and make it a read/write database" "pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version" "pg\:wait":"monitor database creation, exit when complete" + "pg\:backups":"Interact with built-in backups" "pgbackups":"list captured backups" "pgbackups\:url":"get a temporary URL for a backup" "pgbackups\:capture":"capture a backup from a database id" -- cgit v1.2.3-70-g09d2 From e8aaab56b9f007cd5a285099fa101a63214622ee Mon Sep 17 00:00:00 2001 From: Frank Wittig Date: Wed, 9 Apr 2014 18:11:06 +0200 Subject: allow . in profile names --- plugins/aws/aws.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index a326e2e01..183b0f226 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -37,9 +37,8 @@ function asp { } function aws_profiles { - reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) + reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) } - compctl -K aws_profiles asp if which aws_zsh_completer.sh &>/dev/null; then -- cgit v1.2.3-70-g09d2 From 3dab7e46e8815838c8099040e11a7ae9a30ba03d Mon Sep 17 00:00:00 2001 From: dt-rush Date: Thu, 17 May 2018 08:45:04 -0400 Subject: unset chpwd_functions before running cd to work with the path, to avoid side-effects if the user has set any chpwd_functions which cause output, such as is the case if the user is using auto-ls (#6830) --- plugins/shrink-path/shrink-path.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh index f111962a5..6dd6a930f 100644 --- a/plugins/shrink-path/shrink-path.plugin.zsh +++ b/plugins/shrink-path/shrink-path.plugin.zsh @@ -94,6 +94,11 @@ shrink_path () { (( tilde )) && dir=${dir/$HOME/\~} tree=(${(s:/:)dir}) ( + # unset chpwd_functions since we'll be calling `cd` and don't + # want any side-effects (eg., if the user was using auto-ls) + chpwd_functions=() + # unset chpwd since even if chpwd_functions is (), zsh will + # attempt to execute chpwd unfunction chpwd 2> /dev/null if [[ $tree[1] == \~* ]] { cd ${~tree[1]} -- cgit v1.2.3-70-g09d2 From d79086bc87a8728121526081ad8b81e635904f55 Mon Sep 17 00:00:00 2001 From: Matt Lewin Date: Thu, 17 May 2018 10:18:20 -0400 Subject: Update terraform plugin with v0.11.7 commands and help (#6834) --- plugins/terraform/README.md | 8 +- plugins/terraform/_terraform | 192 ++++++++++++++++++++++++++++++++----------- 2 files changed, 149 insertions(+), 51 deletions(-) (limited to 'plugins') diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index 46855e417..e5d9e47b6 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -1,7 +1,9 @@ -## atom +## Terraform oh-my-zsh plugin Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently. +Current as of Terraform v0.11.7 + ### Requirements * [Terraform](https://terraform.io/) @@ -12,8 +14,8 @@ Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely a ### Expanding ZSH prompt with current Terraform workspace name -If you want to get current Terraform workspace name in your ZSH prompt open -your .zsh-theme file and in a choosen place insert: +If you want to get current Terraform workspace name in your ZSH prompt open +your .zsh-theme file and in a chosen place insert: ``` $FG[045]\ diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform index 285d83ec7..1d1315a8a 100644 --- a/plugins/terraform/_terraform +++ b/plugins/terraform/_terraform @@ -3,91 +3,151 @@ local -a _terraform_cmds _terraform_cmds=( 'apply:Builds or changes infrastructure' + 'console:Interactive console for Terraform interpolations' 'destroy:Destroy Terraform-managed infrastructure' + 'fmt:Rewrites config files to canonical format' 'get:Download and install modules for the configuration' 'graph:Create a visual graph of Terraform resources' - 'init:Initializes Terraform configuration from a module' + 'import:Import existing infrastructure into Terraform' + 'init:Initialize a Terraform working directory' 'output:Read an output from a state file' 'plan:Generate and show an execution plan' - 'pull:Refreshes the local state copy from the remote server' - 'push:Uploads the local state to the remote server' + 'providers:Prints a tree of the providers used in the configuration' + 'push:Upload this Terraform module to Atlas to run' 'refresh:Update local state file against real resources' - 'remote:Configures remote state management' 'show:Inspect Terraform state or plan' - 'taint:Manually forcing a destroy and recreate on the next plan/apply' + 'taint:Manually mark a resource for recreation' + 'untaint:Manually unmark a resource as tainted' + 'validate:Validates the Terraform files' 'version:Prints the Terraform version' + 'workspace:Workspace management' ) __apply() { _arguments \ - '-auto-approve[Skip interactive approval of plan before applying.]' \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ + '-auto-approve[Skip interactive approval of plan before applying.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-input=[(true) Ask for input for variables if not directly set.]' \ - '-no-color[If specified, output will not contain any color.]' \ + '-no-color[If specified, output wil be colorless.]' \ + '-parallelism=[(10) Limit the number of parallel resource operations.]' \ '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \ - '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \ + '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]' + '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' +} + +__console() { + _arguments \ + '-state=[(terraform.tfstate) Path to read state.]' \ + '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' } __destroy() { _arguments \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ - '-force[If set, then the destroy confirmation will not be shown.]' \ - '-input=[(true) Ask for input for variables if not directly set.]' \ - '-no-color[If specified, output will not contain any color.]' \ + '-auto-approve[Skip interactive approval before destroying.]' \ + '-force[Deprecated: same as auto-approve.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-parallelism=[(10) Limit the number of concurrent operations.]' \ '-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \ + '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \ - '-target=[(resource) Instead of affecting "dependencies" will instead also destroy any resources that depend on the target(s) specified.]' \ + '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]' + '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' +} + +__fmt() { + _arguments \ + '-list=[(true) List files whose formatting differs (always false if using STDIN)]' \ + '-write=[(true) Write result to source file instead of STDOUT (always false if using STDIN or -check)]' \ + '-diff=[(false) Display diffs of formatting changes]' \ + '-check=[(false) Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]' } __get() { _arguments \ - '-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]' + '-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]' \ + '-no-color[If specified, output will contain no color.]' } __graph() { _arguments \ '-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors.]' \ - '-module-depth=[(n) The maximum depth to expand modules. By default this is zero, which will not expand modules at all.]' \ - '-verbose[Generate a verbose, "worst-case" graph, with all nodes for potential operations in place.]' + '-no-color[If specified, output will contain no color.]' \ + '-type=[(plan) Type of graph to output. Can be: plan, plan-destroy, apply, validate, input, refresh.]' +} + +__import() { + _arguments \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ + '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]' \ + '-allow-missing-config[Allow import when no resource configuration block exists.]' \ + '-input=[(true) Ask for input for variables if not directly set.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-provider=[(provider) Specific provider to use for import. This is used for specifying aliases, such as "aws.eu". Defaults to the normal provider prefix of the resource being imported.]' \ + '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]' \ + '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]' \ + '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \ + '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' } __init() { _arguments \ - '-address=[(url) URL of the remote storage server. Required for HTTP backend, optional for Atlas and Consul.]' \ - '-access-token=[(token) Authentication token for state storage server. Required for Atlas backend, optional for Consul.]' \ - '-backend=[(atlas) Specifies the type of remote backend. Must be one of Atlas, Consul, or HTTP. Defaults to atlas.]' \ - '-backend-config=[(path) Specifies the path to remote backend config file.]' \ - '-name=[(name) Name of the state file in the state storage server. Required for Atlas backend.]' \ - '-path=[(path) Path of the remote state in Consul. Required for the Consul backend.]' + '-backend=[(true) Configure the backend for this configuration.]' \ + '-backend-config=[This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a 'key=value' format. This is merged with what is in the configuration file. This can be specified multiple times. The backend type must be in the configuration itself.]' \ + '-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \ + '-from-module=[Copy the contents of the given module into the target directory before initialization.]' \ + '-get=[(true) Download any modules for this configuration.]' \ + '-get-plugins=[(true) Download any missing plugins for this configuration.]' \ + '-input=[(true) Ask for input if necessary. If false, will error if input was required.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-no-color[If specified, output will contain no color.]' \ + '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]' \ + '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \ + '-upgrade=[(false) If installing modules (-get) or plugins (-get-plugins), ignore previously-downloaded objects and install the latest version allowed within configured constraints.]' \ + '-verify-plugins=[(true) Verify the authenticity and integrity of automatically downloaded plugins.]' } __output() { _arguments \ '-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate".]' \ - '-module=[(module_name) The module path which has needed output. By default this is the root path. Other modules can be specified by a period-separated list.]' + '-no-color[ If specified, output will contain no color.]' \ + '-module=[(name) If specified, returns the outputs for a specific module]' \ + '-json[If specified, machine readable output will be printed in JSON format]' } __plan() { _arguments \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with" .backup" extension. Set to "-" to disable backup.]' \ - '-destroy[If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \ - '-detailed-exitcode[Return a detailed exit code when the command exits. When provided, this argument changes the exit codes and their meanings to provide more granular information about what the resulting plan contains]' \ + '-destroy[() If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \ + '-detailed-exitcode[() Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \ '-input=[(true) Ask for input for variables if not directly set.]' \ - '-module-depth=[(n) Specifies the depth of modules to show in the output. This does not affect the plan itself, only the output shown. By default, this is zero. -1 will expand all.]' \ - '-no-color[If specified, output will not contain any color.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-module-depth=[(n) Specifies the depth of modules to show in the output. This does not affect the plan itself, only the output shown. By default, this is -1, which will expand all.]' \ + '-no-color[() If specified, output will contain no color.]' \ '-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \ + '-parallelism=[(10) Limit the number of concurrent operations.]' \ '-refresh=[(true) Update state prior to checking for differences.]' \ '-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]' \ - '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \ + '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ - '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]' + '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' \ +} + +__providers() { + _arguments \ + } __push() { @@ -106,6 +166,9 @@ __push() { __refresh() { _arguments \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ + '-input=[(true) Ask for input for variables if not directly set.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-no-color[If specified, output will not contain any color.]' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \ '-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \ @@ -114,19 +177,6 @@ __refresh() { '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]' } -__remote() { - _arguments \ - '-address=[(url) URL of the remote storage server. Required for HTTP backend, optional for Atlas and Consul.]' \ - '-access-token=[(token) Authentication token for state storage server. Required for Atlas backend, optional for Consul.]' \ - '-backend=[(atlas) Specifies the type of remote backend. Must be one of Atlas, Consul, or HTTP. Defaults to atlas.]' \ - '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ - '-disable[Disables remote state management and migrates the state to the -state path.]' \ - '-name=[(name) Name of the state file in the state storage server. Required for Atlas backend.]' \ - '-path=[(path) Path of the remote state in Consul. Required for the Consul backend.]' \ - '-pull=[(true) Controls if the remote state is pulled before disabling. This defaults to true to ensure the latest state is cached before disabling.]' \ - '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' -} - __show() { _arguments \ '-module-depth=[(n) The maximum depth to expand modules. By default this is zero, which will not expand modules at all.]' \ @@ -137,12 +187,46 @@ __taint() { _arguments \ '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ '-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \ '-no-color[If specified, output will not contain any color.]' \ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \ '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]' } +__untaint() { + _arguments \ + '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \ + '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \ + '-lock=[(true) Lock the state file when locking is supported.]' \ + '-lock-timeout=[(0s) Duration to retry a state lock.]' \ + '-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \ + '-no-color[If specified, output will not contain any color.]' \ + '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \ + '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]' +} + +__validate() { + _arguments \ + '-check-variables=[(true) If set to true (default), the command will check whether all required variables have been specified.]' \ + '-no-color[If specified, output will not contain any color.]' \ + '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \ + '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]' +} + +__workspace() { + local -a __workspace_cmds + __workspace_cmds=( + 'delete:Delete a workspace' + 'list:List Workspaces' + 'new:Create a new workspace' + 'select:Select a workspace' + 'show:Show the name of the current workspace' + ) + _describe -t workspace "workspace commands" __workspace_cmds +} + _arguments '*:: :->command' if (( CURRENT == 1 )); then @@ -154,26 +238,38 @@ local -a _command_args case "$words[1]" in apply) __apply ;; + console) + __console;; destroy) __destroy ;; + fmt) + __fmt;; get) __get ;; graph) __graph ;; + import) + __import;; init) __init ;; output) __output ;; plan) __plan ;; + providers) + __providers ;; push) __push ;; refresh) __refresh ;; - remote) - __remote ;; show) __show ;; taint) __taint ;; + untaint) + __untaint ;; + validate) + __validate ;; + workspace) + test $CURRENT -lt 3 && __workspace ;; esac -- cgit v1.2.3-70-g09d2 From a600ab4b8578ca0a8e6c6dae0373033b9d8c201c Mon Sep 17 00:00:00 2001 From: Mauro Porras P Date: Thu, 17 May 2018 09:30:03 -0500 Subject: Minor fix: "stdin" instead of "stding" (#6801) --- plugins/docker/_docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 4d1b79a82..32ad4848a 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -889,7 +889,7 @@ __docker_container_subcommand() { $opts_help \ $opts_attach_exec_run_start \ "($help -a --attach)"{-a,--attach}"[Attach container's stdout/stderr and forward all signals]" \ - "($help -i --interactive)"{-i,--interactive}"[Attach container's stding]" \ + "($help -i --interactive)"{-i,--interactive}"[Attach container's stdin]" \ "($help -)*:containers:__docker_complete_stopped_containers" && ret=0 ;; (stats) -- cgit v1.2.3-70-g09d2