Skip to content

docs: show -- when passing Caddy flags through xcaddy - #281

Open
locker95 wants to merge 1 commit into
caddyserver:masterfrom
locker95:fix/docs-pass-through-config-flags-231
Open

docs: show -- when passing Caddy flags through xcaddy#281
locker95 wants to merge 1 commit into
caddyserver:masterfrom
locker95:fix/docs-pass-through-config-flags-231

Conversation

@locker95

Copy link
Copy Markdown

Summary

xcaddy run --config caddy.json fails with unknown flag: --config because cobra parses flags before pass-through. The working form is xcaddy -- run --config caddy.json.

This updates the plugin-development examples in the README and mentions the same in the root command long help so the documented usage matches what cobra actually accepts.

Docs-only (plus a one-line help-text note). No CLI behavior change.

Test plan

  • Checked that README examples use xcaddy -- run --config caddy.json
  • Confirmed root command help text documents the -- separator
  • Manual: from a module that imports a Caddy plugin, xcaddy -- run --config caddy.json runs; bare xcaddy run --config caddy.json still errors as before

Fixes #231

xcaddy uses cobra for its own flags, so `xcaddy run --config ...`
fails with "unknown flag: --config". Pass Caddy args after `--`,
e.g. `xcaddy -- run --config caddy.json`.

Fixes caddyserver#231

Signed-off-by: Dean Chen <862469039@qq.com>
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.

Error: unknown flag: --config on xcaddy run

1 participant