aboutsummaryrefslogtreecommitdiff
path: root/pass-otp.bash.completion
blob: 5b13dcc4bf8324a1041a0f2ac19fc57d34b7167d (plain)
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
PASSWORD_STORE_EXTENSION_COMMANDS+=(otp)

__password_store_extension_complete_otp() {
  if [[ $COMP_CWORD -gt 2 ]]; then
    case "${COMP_WORDS[2]}" in
      insert|append)
        COMPREPLY+=($(compgen -W "-e --echo -f --force -s --secret -i --issuer -a --account" -- ${cur}))
        _pass_complete_entries
        ;;
      uri)
        COMPREPLY+=($(compgen -W "-c --clip -q --qrcode" -- ${cur}))
        _pass_complete_entries
        ;;
      validate)
        _pass_complete_entries
        ;;
      *)
        COMPREPLY+=($(compgen -W "-h --help" -- ${cur}))
        _pass_complete_entries
        ;;
    esac
  else
      COMPREPLY+=($(compgen -W "insert append uri validate -h --help -c --clip" -- ${cur}))
      _pass_complete_entries 1
  fi
}