diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | mingling_core/src/program.rs | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f43976..957952d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,8 @@ fn render_entry_show(_args: EntryShow, res: &mut LazyRes<ResLargeData>) { } ``` +5. **\[core\]** Added `Program::get_args(&self)` method to expose the program's command-line arguments as a `&[String]` slice, providing public read access to the internal `args` field. + #### **BREAKING CHANGES** (API CHANGES): 1. **\[core\]** Changed the signature of `ProgramSetup::setup` from `fn setup(&mut self, program: &mut Program<C>) -> S` to `fn setup(self, program: &mut Program<C>)`, consuming `self` instead of taking a mutable reference. Correspondingly, `Program::with_setup` now accepts `S` by value (`&mut self, setup: S`) instead of by mutable reference (`&mut self, setup: &mut S`). diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index d14c366..12dc9cc 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -124,6 +124,12 @@ where .unwrap() } + /// Returns a reference to the program's command-line arguments. + #[must_use] + pub fn get_args(&self) -> &[String] { + &self.args + } + /// Get all registered dispatcher names from the program #[must_use] pub fn get_nodes( |
