From 88fb6eb07cae2b5ef069d35042ea78c59bde33db Mon Sep 17 00:00:00 2001 From: Benjamin Morrison Date: Fri, 17 Feb 2023 23:23:36 -0500 Subject: kshrc/completions --- .ksh_completions | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .ksh_completions (limited to '.ksh_completions') 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) + -- cgit 1.4.1