[pass] [PATCH] Allow custom subcommands

Lucas Hoffmann l-m-h at web.de
Fri Oct 7 10:33:33 CEST 2016


Quoting Thorsten Wißmann (2016-09-30 11:33:33)
> I have a couple of custom pass scripts (e.g. a custom clipboard
> wizard[1], or a custom file generation script). It would fit perfectly
> to the pass workflow if one could call those directly via pass, e.g.
>
>     pass clipwiz Business/some-silly-business-site.com
>
> which should call
>
>     pass-clipwiz Business/some-silly-business-site.com
>
> if there is an executable pass-clipwiz in the PATH.

Currently there is one official "plugin" or "addon" for pass in the
official repository: passmenu.  But that uses a new script name instead
of hacking into pass subcommands.

This might be because it does not benefit the use case of passmenu much
to exist inside the pass subcommands namespace or it might be to keep
pass simple.

Attached you can find a script that wraps pass in order to call a
subcommand script (it does what you describe above, only in an extra
script).  Maybe if your solution is to intrusive we can add this wrapper
in the contrib/ subdirecory.  Opinions?

> This does not only fit the usual pass workflow (first show a file,
> then paste it using clipwiz), but one also gets the tab-completion for
> custom pass scripts for free.

Some basic level of completion for the wrapper can be achieved in zsh
with a simple "compdef pass-plugin-wrapper=pass".  Only official
subcommands and no plugin commands will be completed like this.  But
passwords will be completed after custom commands.

> Other command line utilities like git or hledger[2] provide those
> custom subcommands, and I'd love to see it in pass as well. I've
> implemented that in the attached git formatted patch, but did not know
> whether/where/how to add an description for that in the man page.

I was also looking for this functionality before so I hope that we will
find some solution that makes it into the repository.

Happy hacking
Lucas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pass-plugin-wrapper
Type: text/x-shellscript
Size: 88 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161007/df6ee623/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161007/df6ee623/attachment.asc>


More information about the Password-Store mailing list