Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] pre 2.0 command description sync (vs. docs) #5315

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dvc/command/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def run(self):

def add_parser(subparsers, parent_parser):
ADD_HELP = "Track data files or directories with DVC."

parser = subparsers.add_parser(
"add",
parents=[parent_parser],
Expand Down
6 changes: 1 addition & 5 deletions dvc/command/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,23 @@ def add_parser(subparsers, parent_parser):
from dvc.command.config import parent_config_parser

CACHE_HELP = "Manage cache settings."

cache_parser = subparsers.add_parser(
"cache",
parents=[parent_parser],
description=append_doc_link(CACHE_HELP, "cache"),
help=CACHE_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter,
)

cache_subparsers = cache_parser.add_subparsers(
dest="cmd",
help="Use `dvc cache CMD --help` for command-specific " "help.",
)

fix_subparsers(cache_subparsers)

parent_cache_config_parser = argparse.ArgumentParser(
add_help=False, parents=[parent_config_parser]
)
CACHE_DIR_HELP = "Configure cache directory location."

CACHE_DIR_HELP = "Configure or show the cache directory location."
cache_dir_parser = cache_subparsers.add_parser(
"dir",
parents=[parent_parser, parent_cache_config_parser],
Expand Down
7 changes: 3 additions & 4 deletions dvc/command/check_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ def run(self):


def add_parser(subparsers, parent_parser):
ADD_HELP = (
CHECKIGNORE_HELP = (
"Check whether files or directories are excluded due to `.dvcignore`."
)

parser = subparsers.add_parser(
"check-ignore",
parents=[parent_parser],
description=append_doc_link(ADD_HELP, "check-ignore"),
help=ADD_HELP,
description=append_doc_link(CHECKIGNORE_HELP, "check-ignore"),
help=CHECKIGNORE_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
Expand Down
3 changes: 1 addition & 2 deletions dvc/command/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
CHECKOUT_HELP = "Checkout data files from cache."

CHECKOUT_HELP = "Restore tracked files and directories in the workspace."
checkout_parser = subparsers.add_parser(
"checkout",
parents=[parent_parser],
Expand Down
5 changes: 1 addition & 4 deletions dvc/command/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
COMMIT_HELP = (
"Record changes to files or directories tracked by DVC"
" by storing the current versions in the cache."
)
COMMIT_HELP = "Record changes to files or directories tracked by DVC."

commit_parser = subparsers.add_parser(
"commit",
Expand Down
3 changes: 1 addition & 2 deletions dvc/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ def _config_file_prefix(show_origin, config, level):


def add_parser(subparsers, parent_parser):
CONFIG_HELP = "Get or set config options."

CONFIG_HELP = "Get or set configuration options."
config_parser = subparsers.add_parser(
"config",
parents=[parent_config_parser, parent_parser],
Expand Down
4 changes: 2 additions & 2 deletions dvc/command/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
DAEMON_HELP = "Service daemon."
DAEMON_HELP = "Service daemon"
daemon_parser = subparsers.add_parser(
"daemon",
parents=[parent_parser],
Expand All @@ -59,7 +59,7 @@ def add_parser(subparsers, parent_parser):
)
daemon_updater_parser.set_defaults(func=CmdDaemonUpdater)

DAEMON_ANALYTICS_HELP = "Send dvc usage analytics."
DAEMON_ANALYTICS_HELP = "Send DVC usage analytics."
daemon_analytics_parser = daemon_subparsers.add_parser(
"analytics",
parents=[parent_parser],
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def run(self):


def add_parser(subparsers, parent_parser):
DAG_HELP = "Visualize DVC project DAG."
DAG_HELP = "Visualize the project's pipeline(s) as one or more graphs."
dag_parser = subparsers.add_parser(
"dag",
parents=[parent_parser],
Expand Down
7 changes: 2 additions & 5 deletions dvc/command/data_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def add_parser(subparsers, _parent_parser):

# Pull
PULL_HELP = "Download tracked files or directories from remote storage."

pull_parser = subparsers.add_parser(
"pull",
parents=[shared_parent_parser()],
Expand Down Expand Up @@ -197,7 +196,6 @@ def add_parser(subparsers, _parent_parser):

# Push
PUSH_HELP = "Upload tracked files or directories to remote storage."

push_parser = subparsers.add_parser(
"push",
parents=[shared_parent_parser()],
Expand Down Expand Up @@ -260,7 +258,6 @@ def add_parser(subparsers, _parent_parser):
FETCH_HELP = (
"Download files or directories from remote storage to the cache."
)

fetch_parser = subparsers.add_parser(
"fetch",
parents=[shared_parent_parser()],
Expand Down Expand Up @@ -318,9 +315,9 @@ def add_parser(subparsers, _parent_parser):

# Status
STATUS_HELP = (
"Show changed stages, compare local cache and a remote storage."
"Report changes in the project's pipelines, and compare"
" the cache to the workspace or to remote storage."
)

status_parser = subparsers.add_parser(
"status",
parents=[shared_parent_parser()],
Expand Down
5 changes: 4 additions & 1 deletion dvc/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def run(self):


def add_parser(subparsers, parent_parser):
DESTROY_HELP = "Remove DVC-files, local DVC config and data cache."
DESTROY_HELP = (
"Terminate the DVC project by removing all DVC files."
" Data files and directories will remain."
)

destroy_parser = subparsers.add_parser(
"destroy",
Expand Down
8 changes: 5 additions & 3 deletions dvc/command/gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ def run(self):


def add_parser(subparsers, parent_parser):
GC_HELP = "Garbage collect unused objects from cache or remote storage."
GC_HELP = (
"Delete unused files and directories from the cache or remote storage."
)
GC_DESCRIPTION = (
"Removes all files in the cache or a remote which are not in\n"
"use by the specified Git revisions (defaults to just HEAD)."
"Delete any files which are not used in the specified Git revisions "
"(defaults to just HEAD) from the cache or remote storage."
)
gc_parser = subparsers.add_parser(
"gc",
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _get_file_from_repo(self):


def add_parser(subparsers, parent_parser):
GET_HELP = "Download file or directory tracked by DVC or by Git."
GET_HELP = "Download a file or directory tracked by DVC or by Git."
get_parser = subparsers.add_parser(
"get",
parents=[parent_parser],
Expand Down
6 changes: 3 additions & 3 deletions dvc/command/get_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def run(self):


def add_parser(subparsers, parent_parser):
GET_HELP = "Download or copy files from URL."
GETURL_HELP = "Download a file or directory from a supported URL."
get_parser = subparsers.add_parser(
"get-url",
parents=[parent_parser],
description=append_doc_link(GET_HELP, "get-url"),
help=GET_HELP,
description=append_doc_link(GETURL_HELP, "get-url"),
help=GETURL_HELP,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
get_parser.add_argument(
Expand Down
10 changes: 5 additions & 5 deletions dvc/command/git_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _run(self):


def add_parser(subparsers, parent_parser):
GIT_HOOK_HELP = "Run GIT hook."
GIT_HOOK_HELP = "Run Git hook."

git_hook_parser = subparsers.add_parser(
"git-hook",
Expand All @@ -98,7 +98,7 @@ def add_parser(subparsers, parent_parser):

fix_subparsers(git_hook_subparsers)

PRE_COMMIT_HELP = "Run pre-commit GIT hook."
PRE_COMMIT_HELP = "Run pre-commit Git hook."
pre_commit_parser = git_hook_subparsers.add_parser(
"pre-commit",
parents=[parent_parser],
Expand All @@ -110,7 +110,7 @@ def add_parser(subparsers, parent_parser):
)
pre_commit_parser.set_defaults(func=CmdPreCommit)

POST_CHECKOUT_HELP = "Run post-checkout GIT hook."
POST_CHECKOUT_HELP = "Run post-checkout Git hook."
post_checkout_parser = git_hook_subparsers.add_parser(
"post-checkout",
parents=[parent_parser],
Expand All @@ -122,7 +122,7 @@ def add_parser(subparsers, parent_parser):
)
post_checkout_parser.set_defaults(func=CmdPostCheckout)

PRE_PUSH_HELP = "Run pre-push GIT hook."
PRE_PUSH_HELP = "Run pre-push Git hook."
pre_push_parser = git_hook_subparsers.add_parser(
"pre-push",
parents=[parent_parser],
Expand All @@ -134,7 +134,7 @@ def add_parser(subparsers, parent_parser):
)
pre_push_parser.set_defaults(func=CmdPrePush)

MERGE_DRIVER_HELP = "Run GIT merge driver."
MERGE_DRIVER_HELP = "Run Git merge driver."
merge_driver_parser = git_hook_subparsers.add_parser(
"merge-driver",
parents=[parent_parser],
Expand Down
4 changes: 2 additions & 2 deletions dvc/command/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def run(self):

def add_parser(subparsers, parent_parser):
IMPORT_HELP = (
"Download file or directory tracked by DVC or by Git "
"into the workspace, and track it."
"Download a file or directory tracked by another DVC or Git "
"repository, and track it."
)

import_parser = subparsers.add_parser(
Expand Down
8 changes: 4 additions & 4 deletions dvc/command/imp_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def run(self):


def add_parser(subparsers, parent_parser):
IMPORT_HELP = (
"Download or copy file from URL and take it under DVC control."
IMPORTURL_HELP = (
"Download a file or directory from a supported URL, and track it."
)

import_parser = subparsers.add_parser(
"import-url",
parents=[parent_parser],
description=append_doc_link(IMPORT_HELP, "import-url"),
help=IMPORT_HELP,
description=append_doc_link(IMPORTURL_HELP, "import-url"),
help=IMPORTURL_HELP,
formatter_class=argparse.RawTextHelpFormatter,
)
import_parser.add_argument(
Expand Down