From b796a3e18ef360f88da138e176734fbfb5efcbd0 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 1 Jun 2026 13:02:50 +0800 Subject: Refactor built-in flags into reusable setup structs --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 61805aa..e7b9257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,17 @@ This macro wraps `::mingling::test::unpack_chain_process_result` to downcast a ` let result = some_chain_function(args).into(); let value: MyType = unpack_chain_process!(result, MyType); ``` +2. **\[core\]** Refactored the built-in flag system in `BasicProgramSetup` into individual, reusable setup structs (`HelpFlagSetup`, `QuietFlagSetup`, `ConfirmFlagSetup`). These setups are now separate implementations of `ProgramSetup`, each with customizable flag aliases and `Default` implementations. `BasicProgramSetup` now composes them via `with_setup` instead of defining flags inline. + +```rust +// Customize individual flags +program.with_setup(HelpFlagSetup::new(["-h", "--help"])); +program.with_setup(QuietFlagSetup::new(["-q", "--quiet"])); +program.with_setup(ConfirmFlagSetup::new(["-C", "--confirm"])); + +// Or use defaults via BasicProgramSetup +program.with_setup(BasicProgramSetup); +``` #### **BREAKING CHANGES** (API CHANGES): -- cgit