summaryrefslogtreecommitdiff
path: root/src/completion (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fish-completion: reuse "git" and "grep" completionsJohannes Altmanninger2020-06-251-8/+12
| | | | | This makes fish complete commands starting with "pass git" as if they were starting with "git".
* fish-completion: don't erase existing completions for passJohannes Altmanninger2020-06-251-1/+0
| | | | fish only loads pass.fish once, so there is no point to erasing them.
* fish-completion: force some variables to be script-localJohannes Altmanninger2020-06-251-2/+2
| | | | | | | Unfortunately, a command "set x" without explicit scope overwrites the variable "x" in the innermost scope it is defined in, if any. This can cause problems if the user defines the variable "x" as global or universal variable (which is visible in all fishes). Make sure to define a local variable so we use that.
* fish-completion: support completions for wrapper commandsJohannes Altmanninger2020-06-251-5/+1
| | | | | | | | | | | | | | | | There is no point to checking the command name, fish already does that. Additionally fish knows about commands that "wrap" pass; those commands should inherit pass's completions. This commit enables fish>=3.1.0 to provide proper completions for this function: alias p="PASSWORD_STORE_DIR=$HOME/.my-passwords pass" or, equivalently, function p --wraps "PASSWORD_STORE_DIR=$HOME/.my-passwords pass" PASSWORD_STORE_DIR=$HOME/.my-passwords pass $argv end
* fish-completion: remove obsolete flagJohannes Altmanninger2020-06-251-57/+57
| | | | | The -A/--authoritative flag no longer has an effect since fish 2.5 which was released in 2017.
* fish-completion: avoid printing errors with an empty password storeJohannes Altmanninger2020-06-251-1/+2
| | | | | | | Reproduce by typing "pass <TAB>" in a shell launched like: HOME=`mktemp -d` fish Fish prints an error on failing globs - except when used in one of the commands "set", "for" or "count". Also quotes are unnecessary here.
* bash-completion: detect whether to use gpg/gpg2 binary for complete keysElan Ruusamäe2018-10-191-1/+4
| | | | Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
* bash_completion: do not leak variables to globals scopeElan Ruusamäe2018-10-191-6/+6
| | | | Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
* Add custom bash completion for extensionsLars Flitter2018-07-261-1/+12
| | | | | Bash completion now allows usage of extension commands. (see pass.bash-completion for details)
* fish: reduce completion runtimesMathis Antony2018-02-191-14/+13
| | | | | | | Fish completion spends most of the time in calls to `sed` in for loops over entries and directories. This patch removes the repeated calls to `sed`. Signed-off-by: Mathis Antony <sveitser@gmail.com>
* zsh-completion: add prefix zstyleBenjamin Richter2016-02-061-1/+11
| | | | | This option can be used to select a different pass repository for completion. A configuration example is given inside the completion file.
* Fix zsh completion when path contains \Simon Gomizelj2016-02-061-1/+1
|
* completion: Output a space when appropriate on bash completionAnas Syed2016-02-061-1/+19
| | | | | | Did this by not passing "-o nospace" to complete. Instead, put "compopt -o nospace" after a COMPREPLY that shouldn't add a space when autocompleting the only match
* bashcomp: PASSWORD_STORE_DIR env var does not necessarily have a trailing slashSamuel Lethiec2015-05-111-0/+2
|
* Fix pass zsh completion and autoloadingMarc Cornellà2014-07-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When autocompleting from `pass <TAB>', sometimes the following errors appear: _values:compvalues:10: not enough arguments find: `/home/user/.password-store': No such file or directory _values:compvalues:10: not enough arguments find: `/home/user/.password-store': No such file or directory The `_values' error happens when there is no password-store folder *or* there are no passwords in pass; the `find' error only when there is no password-store folder. We can trace it back to line 108, which contains the only `_values' statement that is executed when we autocomplete from pass. We confirm this by following the trail of execution, which is _pass -> _pass_cmd_show -> _pass_complete_entries -> -> _pass_complete_entries_helper If we try running the command inside `$()' on line 104, we see that it returns nothing and the output is blank. This means that `_values' only receives 1 of its 2 mandatory parameters, therefore the above error is triggered (not enough arguments). That is unless we don't have a password-store folder, in which case the `find: [...] no such file or directory' error is *also* triggered. We solve the first error by supplying a default value of "" if the command outputs nothing, using the zsh construct ${var:-else}. We solve the second error by redirecting the find command's stderr output to /dev/null, so the error is effectively suppressed. * * * * This patch also fixes the first tab completion, which currently only loads the completion function definition. We do this by adding a `_pass' statement at the end of the file, which runs the `_pass' completion function after loading its definition. This is the standard way an autoloaded function works; for other examples look at zsh's official completion files.
* completion: add new generate flagsJason A. Donenfeld2014-05-083-2/+7
|
* zsh: posix compatible sed fix for zsh-completionJason A. Donenfeld2014-05-081-1/+1
| | | | | This reverts commit 56381287a16792b4c6410f07db68e02f3574c213, and further fixes things.
* zsh-completion: regression when using BSD sedKyle Marek-Spartz2014-05-061-1/+1
| | | | | | | | | | | | | Made sed expression GNU and BSD compatible. A recent change in pass.zsh-completion broke autocompletion when using BSD sed. I’ve made the relevant sed expression compatible with GNU and BSD sed. Previous change with regression: http://lists.zx2c4.com/pipermail/password-store/2014-April/000773.html http://git.zx2c4.com/password-store/commit/src/completion/pass.zsh-completion?id=f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc
* zsh-completion: only remove next char if /Jason A. Donenfeld2014-04-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Kevin: I found a small bug in the zsh completions. Basically when the PASSWORD_STORE_DIR ends in a slash the first character of the result is eaten, making completion essentially useless. (It does this before determining matches). This can be fixed by changing what is line 106 in my version from: _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) to _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\\?##" -e 's#\.gpg##' | sort) The difference is the first sed regex expression. The original version assumed that the next character was a slash and removed it while the new version only removes it if it is a slash. "s#${prefix}.##" -> "s#${prefix}/\\?##" Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reported-by: Kevin Cox <kevincox@kevincox.ca>
* bash-completion: filter dot files from resultsJason A. Donenfeld2014-04-181-3/+8
|
* reencrypt: remove option, do automaticallyJason A. Donenfeld2014-04-183-11/+3
|
* reencryption: add to completion filesJason A. Donenfeld2014-04-183-1/+5
|
* move/copy: always reencrypt passwords at destinationJason A. Donenfeld2014-04-173-3/+8
|
* mv: Add pass mv/rename supportJason A. Donenfeld2014-04-173-0/+15
| | | | | Based-on-work-by: Matthieu Weber <mweber@free.fr> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* grep: add to completion filesJason A. Donenfeld2014-04-153-1/+3
|
* find: add find/search commandJason A. Donenfeld2014-04-153-1/+4
| | | | | | | This relies on a patched version of tree to work, unfortunately. Hopefully upstream will accept our patch. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Make completion cleaner.Jason A. Donenfeld2014-04-061-3/+4
|
* bash-completion: complete the new init -p switch.Jason A. Donenfeld2014-04-061-6/+19
|
* Update zsh completion.Johan Venant2014-03-241-2/+7
|
* Add some commonly used completions for `pass git`Dmitry Medvinsky2014-03-241-0/+3
|
* Update copyright years and email addressDmitry Medvinsky2014-03-241-1/+1
|
* Add `-p` `--path` option completion for `pass init`Dmitry Medvinsky2014-03-241-0/+1
|
* Makefile: do not use recursion and organizeJason A. Donenfeld2014-03-223-0/+307