dvc: update cmd output strings to match docs (#3471)

* metrics show: update -h output to match docs
per https://github.com/iterative/dvc.org/pull/1014/commits/2c3452119545987f77b764e4aa6fc94d051092a7

* metric: update argument desc per iterative/dvc.org/pull/1014

* metrics: match iterative/dvc.org/pull/1014 again...
using term "formatting" instead of "options"

* list: update help output to match iterative/dvc.org/pull/1014
That's iterative/dvc.org/pull/1014

* dvc: add docstring to open_by_relpath
It's a public fn after all. Similar to Repo class

* help: update cmd output strings to match with docs

* remote: update help output

* term: file descriptor -> file object

* metrics: update add and remove help outputs
per https://github.com/iterative/dvc/pull/3471#pullrequestreview-377170844

* remove: update help output
per https://github.com/iterative/dvc/pull/3471#pullrequestreview-377172394

* root: update help output
per https://github.com/iterative/dvc/pull/3471#pullrequestreview-377173196
This commit is contained in:
Jorge Orpinel
2020-03-23 17:40:36 +02:00
committed by GitHub
parent 205a605887
commit 9e7740572c
9 changed files with 23 additions and 21 deletions
+3 -4
View File
@@ -102,7 +102,7 @@ def add_parser(subparsers, _parent_parser):
from dvc.command.status import CmdDataStatus
# Pull
PULL_HELP = "Pull data files from a DVC remote storage."
PULL_HELP = "Download tracked files or directories from remote storage."
pull_parser = subparsers.add_parser(
"pull",
@@ -152,8 +152,7 @@ def add_parser(subparsers, _parent_parser):
pull_parser.set_defaults(func=CmdDataPull)
# Push
PUSH_HELP = "Uploads files or directories tracked by DVC"
" to remote storage."
PUSH_HELP = "Upload tracked files or directories to remote storage."
push_parser = subparsers.add_parser(
"push",
@@ -196,7 +195,7 @@ def add_parser(subparsers, _parent_parser):
push_parser.set_defaults(func=CmdDataPush)
# Fetch
FETCH_HELP = "Get files or directories tracked by DVC from remote storage"
FETCH_HELP = "Get tracked files or directories from remote storage"
" into the cache."
fetch_parser = subparsers.add_parser(
+5 -5
View File
@@ -159,7 +159,7 @@ class CmdMetricsDiff(CmdBase):
def add_parser(subparsers, parent_parser):
METRICS_HELP = "Commands to add, manage, collect and display metrics."
METRICS_HELP = "Commands to add, manage, collect, and display metrics."
metrics_parser = subparsers.add_parser(
"metrics",
@@ -176,7 +176,7 @@ def add_parser(subparsers, parent_parser):
fix_subparsers(metrics_subparsers)
METRICS_SHOW_HELP = "Output metric values."
METRICS_SHOW_HELP = "Print metrics, with optional formatting."
metrics_show_parser = metrics_subparsers.add_parser(
"show",
parents=[parent_parser],
@@ -227,7 +227,7 @@ def add_parser(subparsers, parent_parser):
)
metrics_show_parser.set_defaults(func=CmdMetricsShow)
METRICS_ADD_HELP = "Tag file as a metric file."
METRICS_ADD_HELP = "Mark a DVC-tracked file as a metric."
metrics_add_parser = metrics_subparsers.add_parser(
"add",
parents=[parent_parser],
@@ -244,7 +244,7 @@ def add_parser(subparsers, parent_parser):
metrics_add_parser.add_argument("path", help="Path to a metric file.")
metrics_add_parser.set_defaults(func=CmdMetricsAdd)
METRICS_MODIFY_HELP = "Modify metric file options."
METRICS_MODIFY_HELP = "Modify metric default formatting."
metrics_modify_parser = metrics_subparsers.add_parser(
"modify",
parents=[parent_parser],
@@ -261,7 +261,7 @@ def add_parser(subparsers, parent_parser):
metrics_modify_parser.add_argument("path", help="Path to a metric file.")
metrics_modify_parser.set_defaults(func=CmdMetricsModify)
METRICS_REMOVE_HELP = "Remove files's metric tag."
METRICS_REMOVE_HELP = "Remove metric mark on a DVC-tracked file."
metrics_remove_parser = metrics_subparsers.add_parser(
"remove",
parents=[parent_parser],
+2 -2
View File
@@ -175,7 +175,7 @@ def add_parser(subparsers, parent_parser):
fix_subparsers(pipeline_subparsers)
PIPELINE_SHOW_HELP = "Show pipelines."
PIPELINE_SHOW_HELP = "Show stages in a pipeline."
pipeline_show_parser = pipeline_subparsers.add_parser(
"show",
parents=[parent_parser],
@@ -231,7 +231,7 @@ def add_parser(subparsers, parent_parser):
)
pipeline_show_parser.set_defaults(func=CmdPipelineShow)
PIPELINE_LIST_HELP = "List pipelines."
PIPELINE_LIST_HELP = "List connected groups of stages (pipelines)."
pipeline_list_parser = pipeline_subparsers.add_parser(
"list",
parents=[parent_parser],
+6 -6
View File
@@ -100,7 +100,7 @@ class CmdRemoteList(CmdRemote):
def add_parser(subparsers, parent_parser):
from dvc.command.config import parent_config_parser
REMOTE_HELP = "Manage remote storage configuration."
REMOTE_HELP = "Set up and manage data remotes."
remote_parser = subparsers.add_parser(
"remote",
parents=[parent_parser],
@@ -116,7 +116,7 @@ def add_parser(subparsers, parent_parser):
fix_subparsers(remote_subparsers)
REMOTE_ADD_HELP = "Add remote."
REMOTE_ADD_HELP = "Add a new data remote."
remote_add_parser = remote_subparsers.add_parser(
"add",
parents=[parent_config_parser, parent_parser],
@@ -147,7 +147,7 @@ def add_parser(subparsers, parent_parser):
)
remote_add_parser.set_defaults(func=CmdRemoteAdd)
REMOTE_DEFAULT_HELP = "Set/unset default remote."
REMOTE_DEFAULT_HELP = "Set/unset the default data remote."
remote_default_parser = remote_subparsers.add_parser(
"default",
parents=[parent_config_parser, parent_parser],
@@ -167,7 +167,7 @@ def add_parser(subparsers, parent_parser):
)
remote_default_parser.set_defaults(func=CmdRemoteDefault)
REMOTE_REMOVE_HELP = "Remove remote."
REMOTE_REMOVE_HELP = "Remove a data remote."
remote_remove_parser = remote_subparsers.add_parser(
"remove",
parents=[parent_config_parser, parent_parser],
@@ -180,7 +180,7 @@ def add_parser(subparsers, parent_parser):
)
remote_remove_parser.set_defaults(func=CmdRemoteRemove)
REMOTE_MODIFY_HELP = "Modify remote."
REMOTE_MODIFY_HELP = "Modify the configuration of a data remote."
remote_modify_parser = remote_subparsers.add_parser(
"modify",
parents=[parent_config_parser, parent_parser],
@@ -204,7 +204,7 @@ def add_parser(subparsers, parent_parser):
)
remote_modify_parser.set_defaults(func=CmdRemoteModify)
REMOTE_LIST_HELP = "List available remotes."
REMOTE_LIST_HELP = "List all available data remotes."
remote_list_parser = remote_subparsers.add_parser(
"list",
parents=[parent_config_parser, parent_parser],
+1 -1
View File
@@ -42,7 +42,7 @@ class CmdRemove(CmdBase):
def add_parser(subparsers, parent_parser):
REMOVE_HELP = "Remove DVC-file outputs."
REMOVE_HELP = "Remove DVC-tracked files or directories."
remove_parser = subparsers.add_parser(
"remove",
parents=[parent_parser],
+2 -1
View File
@@ -57,7 +57,8 @@ class CmdRepro(CmdBase):
def add_parser(subparsers, parent_parser):
REPRO_HELP = "Check for changes and reproduce stages and dependencies."
REPRO_HELP = "Reproduce complete or partial pipelines"
" by executing their stages."
repro_parser = subparsers.add_parser(
"repro",
parents=[parent_parser],
+1 -1
View File
@@ -17,7 +17,7 @@ class CmdRoot(CmdBaseNoRepo):
def add_parser(subparsers, parent_parser):
ROOT_HELP = "Relative path to the repository's directory."
ROOT_HELP = "Return the relative path to the root of the DVC project."
root_parser = subparsers.add_parser(
"root",
parents=[parent_parser],
+2 -1
View File
@@ -142,7 +142,8 @@ def _get_dvc_repo_info(repo):
def add_parser(subparsers, parent_parser):
VERSION_HELP = "Show DVC version and system/environment information."
VERSION_HELP = "Display the DVC version"
" and system/environment information."
version_parser = subparsers.add_parser(
"version",
+1
View File
@@ -190,6 +190,7 @@ class ExternalGitRepo:
@contextmanager
def open_by_relpath(self, path, mode="r", encoding=None, **kwargs):
"""Opens a specified resource as a file object."""
try:
abs_path = os.path.join(self.root_dir, path)
with open(abs_path, mode, encoding=encoding) as fd: