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
#!/bin/bash
if which "pass-$1" >/dev/null 2>&1; then
  exec "pass-$@"
fi
exec pass "$@"

Attachment: signature.asc
Description: signature

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to