You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I invoke a command with an required argument (nargs=1) from within another one without passing the argument it still works.
None is passed as default, although I do no set some.
If I invoke the callback I get the expected exception.
Short example
import click
@click.group()
def group():
pass
@group.command()
@click.argument("arg", nargs=1, required=True)
def withparam(arg):
print(
f"INVOKED with argument {arg}"
)
@group.command()
def withoutparam():
print(f"RUNNING without params")
click.get_current_context().invoke(withparam)
if __name__ == "__main__":
group()
Result is:
> python test.py withoutparam
RUNNING without params
INVOKED with argument None
Is this intended?
Environment:
Python version: 3.13
Click version: 8.1.7
The text was updated successfully, but these errors were encountered:
If I invoke a command with an required argument (nargs=1) from within another one without passing the argument it still works.
None is passed as default, although I do no set some.
If I invoke the callback I get the expected exception.
Short example
Result is:
Is this intended?
Environment:
The text was updated successfully, but these errors were encountered: