Skip to content

fix: Support passing multiple extra settings via -e - #3631

Merged
justinmayer merged 1 commit into
getpelican:mainfrom
b84330808:fix-repeated-extra-settings
Nov 8, 2026
Merged

justinmayer merged 1 commit into
getpelican:mainfrom
b84330808:fix-repeated-extra-settings

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

Passing -e / --extra-settings more than once only keeps the settings from the last flag. For example:

pelican content -e 'SITENAME="Mine"' -e DEFAULT_PAGINATION=1 --print-settings SITENAME DEFAULT_PAGINATION

prints the default SITENAME, because the second -e replaced the dict built by the first one. This also bites the generated tasks.py: livereload already passes -e CACHE_CONTENT=true LOAD_CONTENT_CACHE=true, so adding your own -e ... through the pass-through arguments silently drops those two.

ParseOverrides now starts from the overrides already on the namespace and adds the new pairs to them, so repeated flags add up. If the same key is given twice, the later value still wins. I added a test to test_cli.py that fails on main and passes with this change.

Pull Request Checklist

  • Ensured tests pass and (if applicable) updated functional test output
  • Conformed to code style guidelines by running appropriate linting tools
  • Added tests for changed code
  • Updated documentation for changed code

I used Claude Code to write this change.

Each -e / --extra-settings flag replaced the overrides collected by the
previous one, so `pelican content -e A=1 -e B=2` only applied B. Merge
the new KEY=VALUE pairs into the existing overrides instead; a later
value for the same key still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@justinmayer justinmayer changed the title Keep earlier settings when -e is repeated fix: Support passing multiple extra settings via -e Nov 8, 2026

@justinmayer justinmayer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Wei Lun, for the enhancement! 🏅

@justinmayer
justinmayer merged commit 65e8748 into getpelican:main Nov 8, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants