From 6d17bcce93835a6b95059f2d5687f492f4663136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Fri, 23 Sep 2022 13:39:56 +0545 Subject: [PATCH] cli: add help for foreach --- dvc/commands/checkout.py | 2 +- dvc/commands/commit.py | 6 ++++-- dvc/commands/dag.py | 2 +- dvc/commands/data_sync.py | 2 +- dvc/commands/repro.py | 11 ++++++++++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dvc/commands/checkout.py b/dvc/commands/checkout.py index 768872d60..b2822a1d7 100644 --- a/dvc/commands/checkout.py +++ b/dvc/commands/checkout.py @@ -110,7 +110,7 @@ def add_parser(subparsers, parent_parser): nargs="*", help=( "Limit command scope to these tracked files/directories, " - ".dvc files, or stage names." + ".dvc files and stage or foreach-group names." ), ).complete = completion.DVC_FILE checkout_parser.set_defaults(func=CmdCheckout) diff --git a/dvc/commands/commit.py b/dvc/commands/commit.py index c494a3677..b7d856c0c 100644 --- a/dvc/commands/commit.py +++ b/dvc/commands/commit.py @@ -70,7 +70,9 @@ def add_parser(subparsers, parent_parser): commit_parser.add_argument( "targets", nargs="*", - help="stages or .dvc files to commit. Optional. " - "(Finds all DVC files in the workspace by default.)", + help=( + "Limit command scope to these tracked files/directories, " + ".dvc files and stage or foreach-group names." + ), ).complete = completion.DVCFILES_AND_STAGE commit_parser.set_defaults(func=CmdCommit) diff --git a/dvc/commands/dag.py b/dvc/commands/dag.py index 20046badb..5619c2383 100644 --- a/dvc/commands/dag.py +++ b/dvc/commands/dag.py @@ -204,7 +204,7 @@ def add_parser(subparsers, parent_parser): dag_parser.add_argument( "target", nargs="?", - help="Stage or output to show pipeline for (optional). " + help="Stage name, foreach-group name or output to show pipeline for. " "Finds all stages in the workspace by default.", ) dag_parser.set_defaults(func=CmdDAG) diff --git a/dvc/commands/data_sync.py b/dvc/commands/data_sync.py index 13596d9a0..56ac115a8 100644 --- a/dvc/commands/data_sync.py +++ b/dvc/commands/data_sync.py @@ -120,7 +120,7 @@ def shared_parent_parser(): nargs="*", help=( "Limit command scope to these tracked files/directories, " - ".dvc files, or stage names." + ".dvc files and stage or foreach-group names." ), ).complete = completion.DVC_FILE diff --git a/dvc/commands/repro.py b/dvc/commands/repro.py index 98ef6d41b..b5b280a7d 100644 --- a/dvc/commands/repro.py +++ b/dvc/commands/repro.py @@ -55,7 +55,16 @@ def add_arguments(repro_parser): repro_parser.add_argument( "targets", nargs="*", - help="Stages to reproduce. 'dvc.yaml' by default.", + help=( + """\ +Stages to reproduce. 'dvc.yaml' by default. +The targets can be path to a dvc.yaml file or `.dvc` file, +or a stage name or a foreach-group name from dvc.yaml file from +current working directory. To run a stage/foreach-group from dvc.yaml +from other directories, the target must be a path followed by colon `:` +and then the stage name or foreach-group name. +""" + ), ).complete = completion.DVCFILES_AND_STAGE repro_parser.add_argument( "-f",