From 643c8d9a1967cff5ffa41409f3bf4a2cd66cc4e7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 19 Feb 2021 12:31:56 +0100 Subject: [PATCH] added cli command `extractenvironments` to extract environments --- pype/cli.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pype/cli.py b/pype/cli.py index 137ae327b2..0588e8b079 100644 --- a/pype/cli.py +++ b/pype/cli.py @@ -108,6 +108,27 @@ def eventserver(debug, ) +@main.command() +@click.argument("output_json_path") +@click.option("--project", help="Project name", default=None) +@click.option("--asset", help="Asset name", default=None) +@click.option("--task", help="Task name", default=None) +@click.option("--app", help="Application name", default=None) +def extractenvironments(output_json_path, project, asset, task, app): + """Extract environment variables for entered context to a json file. + + Entered output filepath will be created if does not exists. + + All context options must be passed otherwise only pype's global + environments will be extracted. + + Context options are "project", "asset", "task", "app" + """ + PypeCommands().extractenvironments( + output_json_path, project, asset, task, app + ) + + @main.command() @click.argument("paths", nargs=-1) @click.option("-g", "--gui", is_flag=True, help="Run pyblish GUI")