timvisee / prs

🔐 A secure, fast & convenient password manager CLI using GPG and git to sync.
https://gitlab.com/timvisee/prs
GNU General Public License v3.0
211 stars 8 forks source link

Add autocompletion of secret for bash #12

Closed titaniumtraveler closed 2 years ago

titaniumtraveler commented 2 years ago

This is the first implementation for adding autocompletion of secrets to bash as discussed in this comment.

It is using String::replace and therefore the result is not ideal, but at least it works. I also uploaded the modified version I talked about as a gist.

I have a few ideas about a better autocompletion-generation using a combination of str::find and String::replace_range, but that would be a bit more complicated and more fragil.

I used expect in two places, but internally would clap_complete panic in the same situation, so that should be okay?

Ps: That is my first PR to a project that is not one of my own. So if I'm doing anything wrong please tell me so.

timvisee commented 2 years ago

Fantastic. Thanks!

Let me know if you'd like me to release a new version, which includes this change.

titaniumtraveler commented 2 years ago

Not absolutely necessary, but might be helpful.

timvisee commented 2 years ago

I've released this as part of v0.3.5.

It should be available once this release pipeline succeeds: https://gitlab.com/timvisee/prs/-/pipelines/616930460