summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_frontend/cli.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 29fc4cf54..bdcf3ca27 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -719,6 +719,11 @@ def source_fetch(app, elements, deps, track_, except_, track_cross_junctions):
deps = PipelineSelection.ALL
with app.initialized(session_name="Fetch"):
+ if not elements:
+ guessed_target = app.context.guess_element()
+ if guessed_target:
+ elements = (guessed_target,)
+
app.stream.fetch(elements,
selection=deps,
except_targets=except_,
@@ -755,6 +760,11 @@ def source_track(app, elements, deps, except_, cross_junctions):
all: All dependencies of all specified elements
"""
with app.initialized(session_name="Track"):
+ if not elements:
+ guessed_target = app.context.guess_element()
+ if guessed_target:
+ elements = (guessed_target,)
+
# Substitute 'none' for 'redirect' so that element redirections
# will be done
if deps == 'none':