Calling a command defined as @click.group() with standalone_mode=False does not propagate the return value as expected.
For instance:
import click
import sys
@click.group(invoke_without_command=True)
@click.option("-l", "--local-configuration", type=str)
def main(local_configuration):
print('Inside main')
return 1
if __name__ == '__main__':
print(main(sys.argv[1:], standalone_mode=False))
$ python test.py
Inside main
None
It does work when the command is defined with @click.command(), hence I suppose this is a bug.
Environment:
- Python version: 3.7.5
- Click version: 8.0.3
Calling a command defined as
@click.group()withstandalone_mode=Falsedoes not propagate the return value as expected.For instance:
It does work when the command is defined with
@click.command(), hence I suppose this is a bug.Environment: