gopass
gopass copied to clipboard
Can wildcards be used?
Like this.
gopass rm 192.168.*
gopass rm 192.168.*
Error: Can not delete key "192.168.2.0.gpg" from "192.168.1.4.gpg": entry is not in the password store
Actually since this is ZSH's wildcard at work.
This command is equivalent to the following command.
gopass rm 192.168.1.4 192.168.2.0
And it seems that most of the commands of gopass do not support manipulating multiple items at a time, the wildcards supported by ZSH are not actually available.
As you stated wildcard-expansions are done at the shell, and I'm not confident that you get the expected results even if your $PWD is pointing to the store-path. As your snippet shows it also appends the '.gpg' suffix on expansion.
Even if that would be removed, in the current version 'rm' only retrieves the first argument. You can however delete directories recursively.
Wildcards are important, are there any plans to develop this feature?
And I can't seem to use the commands I'm used to, such as rm -rf, which makes me very uncomfortable.
The fuzzy matching of show is useful, can it be applied to the rm command?
gopass rm -rf is supported and should behave like the unix-tool, except with multiple arguments.
Do you have an example where it doesn't?
Currently fuzzy matching is not supported in rm, but I think this could be done.
UPDATE: I'm working with gopass rm with the help of tab-completion, which works great, at least on Bash.
Commands with two or more arguments probably fall into this category.
A workaround could be to use gopass list --flat in combination with grep to select all the secrets you want to remove and then remove them one by one:
$ gopass list --flat | grep 192.168. | while read -r key; do gopass rm -f $key; done
This should be patched by #2239 @daiaji Can you try v1.14.3 and report if it now works as expected on your side?
I think I will try.
Feel free to re-open if still relevant.