Page MenuHomePhabricator

ArgsMan: Add Get*Arg functions returning optional
ClosedPublic

Authored by PiRK on Jan 26 2024, 16:00.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCaabc65b82c1b: ArgsMan: Add Get*Arg functions returning optional
Summary

This allows the caller to not provide a default at all and just check
inside the optional to see if the arg was set or not.

This is a partial backport of core#25290
https://github.com/bitcoin/bitcoin/pull/25290/commits/fc02f77ca604f0221171bfde3059b34f5d0fb1cd

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Jan 26 2024, 16:00
Fabien requested changes to this revision.Jan 26 2024, 19:45
Fabien added a subscriber: Fabien.

Macro lackoftest:

This revision now requires changes to proceed.Jan 26 2024, 19:45

The existing functions now call the new functions, so everything should still be pretty much covered by the existing getarg_tests

In D15297#343995, @PiRK wrote:

The existing functions now call the new functions, so everything should still be pretty much covered by the existing getarg_tests

Good point

This revision is now accepted and ready to land.Jan 29 2024, 14:32