summaryrefslogtreecommitdiff
path: root/contrib/pass.zsh-completion
blob: bc23356483eca834a7f412a6e76af69c04057ee4 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#compdef pass

# This file is under the GPLv2+ license.
# Heavily based on http://zsh.sf.net/Guide/zshguide06.html#l177
# And Frédéric Perrin article http://tar-jx.bz/notes/zsh-completion.html
# Johan Venant, September 2012


_pass () {
  local cmd
  if (( CURRENT > 2)); then
    cmd=${words[2]}
    # Set the context for the subcommand.
    curcontext="${curcontext%:*:*}:pass-$cmd"
    # Narrow the range of words we are looking at to exclude `pass'
    (( CURRENT-- ))
    shift words
    # Run the completion for the subcommand
    (( $+functions[_pass_cmd_$cmd] )) && _pass_cmd_$cmd

  else
    _values : \
      "init[Initialize new password storage]" \
      "ls[subfolder List names of passwords]" \
      "show[Decrypt and print a password]" \
      "insert[Insert a new password]" \
      "generate[Generate a new password using pwgen]" \
      "rm[Remove the password]" \
      "push[push the latest changes using git-push(1)]" \
      "pull[pull the latest changes using git-pull(1)]" \
      "git[Call git]" \
      "help[Help]"
  fi
}

_pass_cmd_init () {
}

_pass_cmd_ls () {
  _arguments : \
    '::ls:_get_stored_pwd'
}

_pass_cmd_show () {
  _arguments : \
    "-c[put it on the clipboard]" \
    '*::show:_get_stored_pwd'
    #'::pass id:_files -W ~/.password-store -g "*.gpg(|.*)(-.)"'
}

_pass_cmd_insert () {
  _arguments : \
    "-n[no console output]" \
    "-m[multiline]" \
    '::show:_get_stored_pwd'
}

_pass_cmd_generate () {
  _arguments : \
    "-n[no symbols]" \
    "-c[put password on the clipboard]" \
    '::show:_get_stored_pwd'
}

_pass_cmd_rm () {
  _arguments : \
    '::ls:_get_stored_pwd'
}

_get_stored_pwd () {
  compadd `find ~/.password-store \( -name .git -o -name .gpg-id \) -prune -o -print | sed 's#.*/.password-store/\?##' | sed 's#\.gpg##' | sort`
}
c65e2&follow=1'>#39 Ignore mails marked as deleted when looking for existing mails, as to not...René 'Necoro' Neumann1-0/+1 2021-02-21go mod tidyRené 'Necoro' Neumann1-8/+0 2021-02-18Import 'embed' packageRené 'Necoro' Neumann1-0/+1 2021-02-16Fix goreleaser setup regarding dockerRené 'Necoro' Neumann1-3/+1 2021-02-16Prepare v0.6.0v0.6.0René 'Necoro' Neumann3-3/+8 2021-02-16Fix CRLF endingRené 'Necoro' Neumann1-57/+57 2021-02-16Increment go-version to 1.16René 'Necoro' Neumann3-5/+5 2021-02-16Use go-embed for templates instead of inline strings.René 'Necoro' Neumann6-74/+79 2021-02-16Issue #46: Fix semantics of `n` resultRené 'Necoro' Neumann2-9/+15 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. This...René 'Necoro' Neumann2-2/+66 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0