1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! 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.
//!
//! | Plugin | Implementation name | Behaviour |
//! |------------------|---------------------|----------------------------------------------|
//! | [`HelpPlugin`] | `system_help` | Same as `SystemPlugin`'s `system_help` |
//! | [`VersionPlugin`] | `system_version` | Same as `SystemPlugin`'s `system_version` |
//! | [`ExitPlugin`] | `system_exit` | Same 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);
//! ```
pub use ExitPlugin;
pub use HelpPlugin;
pub use VersionPlugin;
pub use SysInfoPlugin;
pub use EnvPlugin;
pub use ConfigPlugin;