Show built-in option defaults in --help regardless of overrides#401
Show built-in option defaults in --help regardless of overrides#401gmipf wants to merge 1 commit into
Conversation
printUsage() formatted the "(default: ...)" hint for several value options from the parsed Options members. Since options are parsed before --help is handled, "redumper --retries=9 --help" printed the supplied value (9) as the default instead of the built-in 0. The same drift affected --skip-fill, --plextor-leadin-retries, --mediatek-leadout-retries, --audio-silence-threshold, --cdr-error-threshold and --scsi-timeout. Source these defaults from shared static constexpr *_default constants used both to initialize the members and to render the help text, so --help always shows the compile-time default. Plain --help is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSeven ChangesCompile-time default constants for Options
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
printUsage()formats the "(default: …)" hint for several value options from the parsedOptionsmembers. Because options are parsed before--helpis handled, passing one of these together with--helpprints the supplied value as the "default".Before (b726, current
main):After (this PR):
The same drift also affected
--mediatek-leadout-retries,--audio-silence-thresholdand--cdr-error-threshold. Plainredumper --help(no overrides) is unchanged.Fix
Source these defaults from shared
static constexpr *_defaultconstants used both to initialize the members and to render the help text, so--helpalways shows the compile-time default regardless of argv. One file, no behavior change beyond the help text.Verification
Built and tested in a container matching the CI toolchain (Ubuntu 24.04, clang-18 / libc++-18):
clang-format-18 --dry-run -Werror options.ixx— cleanctest— 358/358 passedThis is the one self-contained fix split out of #400 (man-page generator, which I'm withdrawing).
Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.
Summary by CodeRabbit