summary refs log tree commit diff stats
path: root/.ksh_completions
diff options
context:
space:
mode:
Diffstat (limited to '.ksh_completions')
-rw-r--r--.ksh_completions29
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)
+