|
certbotbot
Reference documentation for a modular Bash project
|
Provides the stable registry used by automatically discovered plugins. More...
Functions | |
| int | bash_starter_plugin_register (String name, String function_name, String description) |
| Registers one plugin implementation with the runtime registry. | |
| int | bash_starter_plugin_list () |
| Prints registered plugins and their descriptions. | |
| int | bash_starter_plugin_run (String name, String arg) |
| Dispatches execution to a registered plugin by logical name. | |
Provides the stable registry used by automatically discovered plugins.
The build appends plugin files after this core module in deterministic lexical order. Each plugin registers a logical name, a human-readable description, and the function that implements the plugin. Runtime dispatch therefore depends on registry state rather than a central list of known plugin names.
The registry deliberately owns only discovery metadata and dispatch. A real project may add richer capability metadata, lifecycle hooks, or typed plugin categories, but those additions should extend this narrow contract rather than introduce plugin-specific branches into unrelated core code.
| int bash_starter_plugin_list | ( | ) |
Prints registered plugins and their descriptions.
Plugins are emitted in registration order. The build sorts plugin source paths lexically, making this output deterministic for a given source tree.
| 0 | The registry was printed successfully. |
| int bash_starter_plugin_register | ( | String | name, |
| String | function_name, | ||
| String | description | ||
| ) |
Registers one plugin implementation with the runtime registry.
Registration is explicit even though source discovery is automatic. This gives each plugin control over its public logical name while keeping the build independent of a hard-coded plugin inventory. Duplicate names are rejected because silent replacement would make behavior depend on lexical file order.
| name | Stable logical plugin name exposed to callers. |
| function_name | Bash function that implements the plugin. |
| description | Human-readable one-line plugin description. |
| 0 | The plugin was registered. |
| 64 | A required argument was empty or the name was already registered. |
| int bash_starter_plugin_run | ( | String | name, |
| String | arg | ||
| ) |
Dispatches execution to a registered plugin by logical name.
The dispatcher validates registry membership before performing an associative array lookup. Bash treats an empty associative-array subscript as an error, so the explicit empty-name guard is part of the public invalid-input contract, not merely defensive decoration. Valid calls invoke the registered function with all remaining arguments unchanged.
| name | Logical plugin name. |
| arg | Arguments forwarded to the plugin implementation. |
| 0 | The selected plugin completed successfully. |
| 69 | No plugin with the requested name is registered. |