diff options
author | Benjamin Morrison <ben@gbmor.org> | 2023-02-17 23:23:36 -0500 |
---|---|---|
committer | Benjamin Morrison <ben@gbmor.org> | 2023-02-17 23:23:36 -0500 |
commit | 88fb6eb07cae2b5ef069d35042ea78c59bde33db (patch) | |
tree | 4909605e85b9ca5506c6cebc358ed62b9e5a51e4 /.ksh_completions | |
parent | d60b99e02e0b5e8b1ba8b0fb82dbc2cde58c0c08 (diff) | |
download | dogfiles-88fb6eb07cae2b5ef069d35042ea78c59bde33db.tar.gz |
kshrc/completions
Diffstat (limited to '.ksh_completions')
-rw-r--r-- | .ksh_completions | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.ksh_completions b/.ksh_completions new file mode 100644 index 0000000..f6eab1d --- /dev/null +++ b/.ksh_completions @@ -0,0 +1,29 @@ +#shellcheck shell=ksh + +_SSH_HOSTS=$(awk '/^Host/ {print $2}' ~/.ssh/config) + +#shellcheck disable=2086 +set -A complete_mosh -- $_SSH_HOSTS + +#shellcheck disable=2086 +set -A complete_scp -- $_SSH_HOSTS + +#shellcheck disable=2086 +set -A complete_rsync -- $_SSH_HOSTS + +#shellcheck disable=2086 +set -A complete_ssh -- $_SSH_HOSTS + +_passwordStoreEntries() { + _passDir="$HOME/.password-store" + find "$_passDir" -type f -iname '*.gpg' | while read -r _line; do + _line="${_line##"$_passDir"}" + _line="${_line#/}" + _line="${_line%.gpg}" + echo "$_line" + done +} + +#shellcheck disable=SC2046 +set -A complete_pass -- -c show find otp grep insert edit generate rm mv cp $(_passwordStoreEntries) + |