Skip to main content

Module builtin

Module builtin 

Source
Expand description

Standalone, single-command plugins.

SystemPlugin (in crate::plugin::system) bundles help, version, and exit into a single plugin. This module offers the same three commands as independent plugins — HelpPlugin, VersionPlugin, ExitPlugin — for applications that want to compose only the ones they need (e.g. version alone, without help/exit).

§Relationship to SystemPlugin

Each plugin here reuses the exact same handler logic as its SystemPlugin counterpart (SystemHelpHandler, SystemVersionHandler, SystemExitHandler in crate::plugin::system) — this is a pure internal refactor (#44 / DD-025). SystemPlugin’s public API, its handlers() output, and its existing test suite are unaffected.

PluginImplementation nameBehaviour
HelpPluginsystem_helpSame as SystemPlugin’s system_help
VersionPluginsystem_versionSame as SystemPlugin’s system_version
ExitPluginsystem_exitSame as SystemPlugin’s system_exit

Implementation names are unchanged, so existing YAML configs that reference system_help / system_version / system_exit keep working whether the commands are wired through SystemPlugin or through these granular plugins.

§Example

use dynamic_cli::plugin::{Plugin, VersionPlugin};

// Register only `version`, without `help` or `exit`.
let plugin = VersionPlugin::new();
assert_eq!(plugin.handlers().len(), 1);

Structs§

ConfigPlugin
Standalone plugin providing config commands: show and validate.
EnvPlugin
Standalone plugin providing a single env command.
ExitPlugin
Standalone builtin providing only the exit command.
HelpPlugin
Standalone builtin providing only the help command.
SysInfoPlugin
Standalone plugin providing a single sysinfo command.
VersionPlugin
Standalone builtin providing only the version command.