Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass around default arguments when calling argument providers #1808

Merged
merged 4 commits into from
Nov 19, 2023

Conversation

kaste
Copy link
Collaborator

@kaste kaste commented Nov 19, 2023

Generally, argument providers are only available for "required"
positional arguments and compute their value if not provided when
calling the command. E.g. they ask for something using an input handler
or a quick panel.

In contrast, keyword arguments have their defaults by definition in the
method signature.

Let's pass those static default arguments down to the provider for
easier usage. Doing so providers do not have to check for a value
being set or missing.

This a precursor to applying Pavel's patch from #1797 again.

Generally, argument providers are only available for "required"
positional arguments and compute their value if not provided when
calling the command.  E.g. they ask for something using an input handler
or a quick panel.

In contrast, keyword arguments have their defaults by definition in the
method signature.

Let's pass those static default arguments down to the provider for
easier usage.  Doing so providers do not have to check for a value
being set or missing.
@kaste kaste enabled auto-merge November 19, 2023 17:29
@kaste kaste merged commit a45861c into master Nov 19, 2023
8 checks passed
@kaste kaste deleted the fill-in-default-parameters branch November 19, 2023 17:30
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.

1 participant