Skip to content

docs: clarify Context.invoke behavior for required arguments#3297

Closed
wwenrr wants to merge 1 commit intopallets:mainfrom
wwenrr:docs/2801-clarify-context-invoke-required-args
Closed

docs: clarify Context.invoke behavior for required arguments#3297
wwenrr wants to merge 1 commit intopallets:mainfrom
wwenrr:docs/2801-clarify-context-invoke-required-args

Conversation

@wwenrr
Copy link
Copy Markdown

@wwenrr wwenrr commented Apr 1, 2026

Summary

Clarify docs for Context.invoke / Context.forward to explain behavior from #2801:

  • invoking another command programmatically does not perform command-line parsing for that command
  • required parameter validation is therefore different from shell invocation unless values are passed explicitly
  • omitting required argument values in ctx.invoke(...) can result in None reaching the callback

Why

Issue #2801 reports that invoking a command with required arguments from another command can still execute and receive None.

Maintainer feedback indicates this behavior is intended, but the docs for command invocation should make this explicit so users don't misinterpret it as a bug.

Changes

File updated:

  • docs/advanced.md ("Invoking Other Commands" section)

Added a concise note describing the parsing/validation difference and a concrete ctx.invoke(other_cmd) example outcome.

Scope

  • Documentation only
  • No runtime behavior changes
  • No API changes

Closes #2801

@davidism davidism closed this Apr 1, 2026
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.

Invoking a command does not fail on missing arguments

2 participants