summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_frontend/cli.py')
-rw-r--r--buildstream/_frontend/cli.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 85632959f..53edc0b71 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -663,6 +663,33 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar):
##################################################################
+# Source Checkout Command #
+##################################################################
+@cli.command(name='source-checkout', short_help='Checkout sources for an element')
+@click.option('--except', 'except_', multiple=True,
+ type=click.Path(readable=False),
+ help="Except certain dependencies")
+@click.option('--deps', '-d', default='none',
+ type=click.Choice(['build', 'none', 'run', 'all']),
+ help='The dependencies whose sources to checkout (default: none)')
+@click.option('--fetch', 'fetch_', default=False, is_flag=True,
+ help='Fetch elements if they are not fetched')
+@click.argument('element',
+ type=click.Path(readable=False))
+@click.argument('location', type=click.Path())
+@click.pass_obj
+def source_checkout(app, element, location, deps, fetch_, except_):
+ """Checkout sources of an element to the specified location
+ """
+ with app.initialized():
+ app.stream.source_checkout(element,
+ location=location,
+ deps=deps,
+ fetch=fetch_,
+ except_targets=except_)
+
+
+##################################################################
# Workspace Command #
##################################################################
@cli.group(short_help="Manipulate developer workspaces")