While I don't really know enough bash to properly review the code, I love the idea. The pass module for Pext actually uses --help to get a list of all commands that can be ran, so this should allow the Pext module to immediately offer basic support for some extensions that don't need special handling.

On 22/03/17 23:57, HacKan wrote:
I'm starting a new thread, but for previous reference, see [1].
This patch aims to improve pass's connection with extensions by showing help 
from them when pass's help command is issued. It's backwards compatible.

Extension makers could add a help function named like `help_extensionname()`, 
which pass looks for and calls during help command execution.

If such function doesn't exists, then it shows "no help available". If there are no 
enabled extensions, then "no extensions enabled" is shown. If there are no extensions at 
all, then it shows regular help.

This is very usefull for those who love using extensions, and doesn't impact at 
all on users who don't use them. It even reminds you of the extensions you have 
installed by listing them.


Example with extensions enabled:
     Usage:
         ...
         pass version
             Show version information.

     From extensions:
         pass example
             This is an example extension.
         pass nohelp
             (no help available)

     More information may be found in the pass(1) man page.


Example without extensions enabled:
     Usage:
         ...
         pass version
             Show version information.

     From extensions:
         (no extensions enabled)

     More information may be found in the pass(1) man page.


Example without extensions (shows regular help statement):
     Usage:
         ...
         pass version
             Show version information.

     More information may be found in the pass(1) man page.


[1] [PATCHES] improve extensions support 
(https://lists.zx2c4.com/pipermail/password-store/2017-February/002799.html)

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

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

Reply via email to