Say I have a basic click CLI command defined in a file cli.py
:
import click
@click.command()
@click.option('--test-option')
def get_inputs(test_option):
return test_option
Then another module script test_cli.py
, from which I'd like to use the CLI defined in the above:
from cli import get_inputs
print('before calling get_inputs')
print(get_inputs())
print('after calling get_inputs')
Then on the command line:
$ python test_cli.py --test-option test123
before calling get_inputs
So it appears that after a Click command is ran, the entire Python process finishes, and even if there are statements and expressions to be evaluated after that Click command in the script that initiated the call, they will not be executed. How would I achieve this?