Merge pull request #4203 from pypeclub/feature/default_cli_for_headless

General: Default command for headless mode is interactive
This commit is contained in:
Jakub Trllo 2022-12-13 13:11:24 +01:00 committed by GitHub
commit ad9f185816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,8 +29,14 @@ def main(ctx):
It wraps different commands together.
"""
if ctx.invoked_subcommand is None:
ctx.invoke(tray)
# Print help if headless mode is used
if os.environ.get("OPENPYPE_HEADLESS_MODE") == "1":
print(ctx.get_help())
sys.exit(0)
else:
ctx.invoke(tray)
@main.command()