summary refs log tree commit diff stats
path: root/.ksh_completions
blob: f6eab1df95914d52614d31f35084eea915311c8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)