Fix: Disable built-in --version and --help flags to allow custom options #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes issue #13 where the
makeConfigfunction failed to parse custom--versionand--helpoptions because yargs' built-in flags overrode user-defined options.Fixes #13
Problem
The
makeConfigfunction was returningfalseinstead of the provided value when users defined custom--versionor--helpoptions. This caused release scripts to fail in CI/CD pipelines.Root Cause: The final yargs instance (src/index.js:360-364) was missing
.help(false)and.version(false)calls, while the initial parse (lines 337-345) correctly disabled these built-in flags.Solution
Added
.help(false)and.version(false)to the final yargs instance to maintain consistency with the initial parse and allow user-defined options.Changes
.help(false)and.version(false)to final yargs instance--versionand--helpoptionsCode Change
Testing
Test Coverage
✅ All 54 tests pass (including 7 new tests)
--versionoption with value--versionoption without value (uses default)--versionoption from environment via getenv--helpoption with value--helpoption without value (uses default)--helpoption from environment via getenv--versionand--helpcustom options simultaneouslyBefore Fix
After Fix
CI Status
✅ All checks pass:
Case Study
A comprehensive case study has been created at
docs/case-studies/issue-13/case-study-analysis.mdthat includes:This analysis was requested by @konard to ensure thorough understanding and documentation of the issue.
Backwards Compatibility
✅ No breaking changes - users who weren't using
--versionor--helpas custom options are unaffected.🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com