Skip to content

caddyfile: clarify ArgErr documentation - #7960

Merged
francislavoie merged 1 commit into
caddyserver:masterfrom
0jaspahwa:docs/argerr-comment
Aug 25, 2026
Merged

francislavoie merged 1 commit into
caddyserver:masterfrom
0jaspahwa:docs/argerr-comment

Conversation

@0jaspahwa

Copy link
Copy Markdown
Contributor

Closes #7959

ArgErr is called both when a required argument is missing and when an unexpected extra argument is found, but the doc comment only described the missing case. Since it's used ~450 times across the repo and by anyone writing a custom module parser, the narrower wording is misleading.

Examples of both directions in the current code:

  • caddyhttp/celmatcher.go errors when NextArg() returns false (missing)
  • caddyhttp/caddyauth/caddyfile.go errors when NextArg() returns true (extra)

Also adds a line pointing at Errf / SyntaxErr for the case where an argument is present but its value is invalid, per @steadytao's note on the issue.

Docs only, no behaviour change.

Assistance Disclosure

Used Claude to help navigate the codebase and discuss wording. I read the source, verified both usage patterns myself, and wrote the change.

Signed-off-by: 0jaspahwa <ojaspahwa20@gmail.com>
@CLAassistant

CLAassistant commented Aug 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@francislavoie
francislavoie enabled auto-merge (squash) August 25, 2026 11:51
@francislavoie
francislavoie merged commit 8b62e3c into caddyserver:master Aug 25, 2026
24 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.

Clarifying the caddyfile.Dispenser.ArgErr() documentation

3 participants