From 2ba657c77ac071fb98e35080196853cb2188d245 Mon Sep 17 00:00:00 2001 From: Lee Yi Jie Joel Date: Fri, 22 Mar 2019 11:32:06 -0700 Subject: [PATCH] Add links to documentation for all commands (#1767) --- dvc/command/add.py | 5 ++++- dvc/command/cache.py | 4 +++- dvc/command/checkout.py | 5 ++++- dvc/command/commit.py | 5 ++++- dvc/command/config.py | 5 ++++- dvc/command/data_sync.py | 19 +++++++++++++++---- dvc/command/destroy.py | 3 ++- dvc/command/gc.py | 3 ++- dvc/command/imp.py | 4 +++- dvc/command/init.py | 4 +++- dvc/command/install.py | 5 ++++- dvc/command/lock.py | 4 ++-- dvc/command/metrics.py | 23 ++++++++++++++++++----- dvc/command/move.py | 6 +++++- dvc/command/pipeline.py | 4 +++- dvc/command/remote.py | 24 +++++++++++++++++------- dvc/command/remove.py | 5 ++++- dvc/command/repro.py | 5 ++++- dvc/command/root.py | 5 ++++- dvc/command/run.py | 3 ++- dvc/command/unprotect.py | 5 ++++- 21 files changed, 111 insertions(+), 35 deletions(-) diff --git a/dvc/command/add.py b/dvc/command/add.py index 68c81db52..d9c1da4b9 100644 --- a/dvc/command/add.py +++ b/dvc/command/add.py @@ -26,7 +26,10 @@ class CmdAdd(CmdBase): def add_parser(subparsers, parent_parser): - ADD_HELP = "Add files/directories to dvc." + ADD_HELP = ( + "Add files/directories to dvc.\n" + "documentation: https://man.dvc.org/add" + ) add_parser = subparsers.add_parser( "add", parents=[parent_parser], description=ADD_HELP, help=ADD_HELP ) diff --git a/dvc/command/cache.py b/dvc/command/cache.py index 42edab5cd..237b21b38 100644 --- a/dvc/command/cache.py +++ b/dvc/command/cache.py @@ -20,7 +20,9 @@ class CmdCacheDir(CmdConfig): def add_parser(subparsers, parent_parser): from dvc.command.config import parent_config_parser - CACHE_HELP = "Manage cache settings." + CACHE_HELP = ( + "Manage cache settings.\ndocumentation: https://man.dvc.org/cache" + ) cache_parser = subparsers.add_parser( "cache", parents=[parent_parser], diff --git a/dvc/command/checkout.py b/dvc/command/checkout.py index 49a3efd21..be4710870 100644 --- a/dvc/command/checkout.py +++ b/dvc/command/checkout.py @@ -18,7 +18,10 @@ class CmdCheckout(CmdBase): def add_parser(subparsers, parent_parser): - CHECKOUT_HELP = "Checkout data files from cache." + CHECKOUT_HELP = ( + "Checkout data files from cache.\n" + "documentation: https://man.dvc.org/checkout" + ) checkout_parser = subparsers.add_parser( "checkout", parents=[parent_parser], diff --git a/dvc/command/commit.py b/dvc/command/commit.py index f45763e3b..a840f7c3f 100644 --- a/dvc/command/commit.py +++ b/dvc/command/commit.py @@ -29,7 +29,10 @@ class CmdCommit(CmdBase): def add_parser(subparsers, parent_parser): - COMMIT_HELP = "Record changes to the repository." + COMMIT_HELP = ( + "Record changes to the repository.\n" + "documentation: https://man.dvc.org/commit" + ) commit_parser = subparsers.add_parser( "commit", parents=[parent_parser], diff --git a/dvc/command/config.py b/dvc/command/config.py index 72ac8cc47..97db45d6e 100644 --- a/dvc/command/config.py +++ b/dvc/command/config.py @@ -98,7 +98,10 @@ parent_config_parser.add_argument( def add_parser(subparsers, parent_parser): - CONFIG_HELP = "Get or set config options." + CONFIG_HELP = ( + "Get or set config options.\n" + "documentation: https://man.dvc.org/config" + ) config_parser = subparsers.add_parser( "config", parents=[parent_config_parser, parent_parser], diff --git a/dvc/command/data_sync.py b/dvc/command/data_sync.py index 2dc17e00f..09d204fce 100644 --- a/dvc/command/data_sync.py +++ b/dvc/command/data_sync.py @@ -120,7 +120,10 @@ def add_parser(subparsers, _parent_parser): from dvc.command.status import CmdDataStatus # Pull - PULL_HELP = "Pull data files from the cloud." + PULL_HELP = ( + "Pull data files from the cloud.\n" + "documentation: https://man.dvc.org/pull" + ) pull_parser = subparsers.add_parser( "pull", parents=[shared_parent_parser()], @@ -168,7 +171,10 @@ def add_parser(subparsers, _parent_parser): pull_parser.set_defaults(func=CmdDataPull) # Push - PUSH_HELP = "Push data files to the cloud." + PUSH_HELP = ( + "Push data files to the cloud.\n" + "documentation: https://man.dvc.org/push" + ) push_parser = subparsers.add_parser( "push", parents=[shared_parent_parser()], @@ -209,7 +215,10 @@ def add_parser(subparsers, _parent_parser): push_parser.set_defaults(func=CmdDataPush) # Fetch - FETCH_HELP = "Fetch data files from the cloud." + FETCH_HELP = ( + "Fetch data files from the cloud.\n" + "documentation: https://man.dvc.org/fetch" + ) fetch_parser = subparsers.add_parser( "fetch", parents=[shared_parent_parser()], @@ -250,7 +259,9 @@ def add_parser(subparsers, _parent_parser): fetch_parser.set_defaults(func=CmdDataFetch) # Status - STATUS_HELP = "Show the repo status." + STATUS_HELP = ( + "Show the repo status.\ndocumentation: https://man.dvc.org/status" + ) status_parser = subparsers.add_parser( "status", parents=[shared_parent_parser()], diff --git a/dvc/command/destroy.py b/dvc/command/destroy.py index 3ef49f664..aab1d9bfc 100644 --- a/dvc/command/destroy.py +++ b/dvc/command/destroy.py @@ -32,7 +32,8 @@ class CmdDestroy(CmdBase): def add_parser(subparsers, parent_parser): DESTROY_HELP = ( "Destroy dvc. Will remove all repo's information, " - "data files and cache." + "data files and cache.\n" + "documentation: https://man.dvc.org/destroy" ) destroy_parser = subparsers.add_parser( "destroy", diff --git a/dvc/command/gc.py b/dvc/command/gc.py index 0d38e5acc..1489caebe 100644 --- a/dvc/command/gc.py +++ b/dvc/command/gc.py @@ -49,7 +49,8 @@ def add_parser(subparsers, parent_parser): GC_HELP = ( "Collect garbage from your DVC cache. \n" "Deletes all files in the cache which are not in use by the \n" - "specified git references (defaults to just HEAD)." + "specified git references (defaults to just HEAD).\n" + "documentation: https://man.dvc.org/gc" ) gc_parser = subparsers.add_parser( "gc", parents=[parent_parser], description=GC_HELP, help=GC_HELP diff --git a/dvc/command/imp.py b/dvc/command/imp.py index 82b96b22c..ae0c2f457 100644 --- a/dvc/command/imp.py +++ b/dvc/command/imp.py @@ -28,7 +28,9 @@ class CmdImport(CmdBase): def add_parser(subparsers, parent_parser): - IMPORT_HELP = "Import files from URL." + IMPORT_HELP = ( + "Import files from URL.\ndocumentation: https://man.dvc.org/import" + ) import_parser = subparsers.add_parser( "import", parents=[parent_parser], diff --git a/dvc/command/init.py b/dvc/command/init.py index 3864c6f6d..134327317 100644 --- a/dvc/command/init.py +++ b/dvc/command/init.py @@ -25,7 +25,9 @@ class CmdInit(object): def add_parser(subparsers, parent_parser): """Setup parser for `dvc init`.""" INIT_HELP = ( - "Initialize dvc over a directory " "(should already be a git dir)." + "Initialize dvc over a directory " + "(should already be a git dir).\n" + "documentation: https://man.dvc.org/init " ) init_parser = subparsers.add_parser( "init", parents=[parent_parser], description=INIT_HELP, help=INIT_HELP diff --git a/dvc/command/install.py b/dvc/command/install.py index f587b734d..1d7bdee09 100644 --- a/dvc/command/install.py +++ b/dvc/command/install.py @@ -15,7 +15,10 @@ class CmdInstall(CmdBase): def add_parser(subparsers, parent_parser): - INSTALL_HELP = "Install dvc hooks into the repository." + INSTALL_HELP = ( + "Install dvc hooks into the repository.\n" + "documentation: https://man.dvc.org/install" + ) install_parser = subparsers.add_parser( "install", parents=[parent_parser], diff --git a/dvc/command/lock.py b/dvc/command/lock.py index 79f105a1f..afe614001 100644 --- a/dvc/command/lock.py +++ b/dvc/command/lock.py @@ -32,14 +32,14 @@ class CmdUnlock(CmdLockBase): def add_parser(subparsers, parent_parser): - LOCK_HELP = "Lock DVC file." + LOCK_HELP = "Lock DVC file.\ndocumentation: https://man.dvc.org/lock" lock_parser = subparsers.add_parser( "lock", parents=[parent_parser], description=LOCK_HELP, help=LOCK_HELP ) lock_parser.add_argument("targets", nargs="+", help="DVC files.") lock_parser.set_defaults(func=CmdLock) - UNLOCK_HELP = "Unlock DVC file." + UNLOCK_HELP = "Unlock DVC file.\ndocumentation: https://man.dvc.org/unlock" unlock_parser = subparsers.add_parser( "unlock", parents=[parent_parser], diff --git a/dvc/command/metrics.py b/dvc/command/metrics.py index 535fa3a6d..e12210688 100644 --- a/dvc/command/metrics.py +++ b/dvc/command/metrics.py @@ -77,7 +77,7 @@ class CmdMetricsRemove(CmdBase): def add_parser(subparsers, parent_parser): METRICS_HELP = ( "A set of commands to add, manage, collect and display project " - "metrics." + "metrics.\ndocumentation: https://man.dvc.org/metrics" ) metrics_parser = subparsers.add_parser( "metrics", @@ -93,7 +93,10 @@ def add_parser(subparsers, parent_parser): fix_subparsers(metrics_subparsers) - METRICS_SHOW_HELP = "Output metric values." + METRICS_SHOW_HELP = ( + "Output metric values.\n" + "documentation: https://man.dvc.org/metrics-show" + ) metrics_show_parser = metrics_subparsers.add_parser( "show", parents=[parent_parser], @@ -135,7 +138,10 @@ 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 = ( + "Tag file as a metric file.\n" + "documentation: https://man.dvc.org/metrics-add" + ) metrics_add_parser = metrics_subparsers.add_parser( "add", parents=[parent_parser], @@ -151,7 +157,10 @@ 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 file options.\n" + "documentation: https://man.dvc.org/metrics-modify " + ) metrics_modify_parser = metrics_subparsers.add_parser( "modify", parents=[parent_parser], @@ -167,7 +176,11 @@ 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 files's metric tag.\n" + "documentation: https://man.dvc.org/metrics-remove" + ) + metrics_remove_parser = metrics_subparsers.add_parser( "remove", parents=[parent_parser], diff --git a/dvc/command/move.py b/dvc/command/move.py index c44a0aba1..93bec3943 100644 --- a/dvc/command/move.py +++ b/dvc/command/move.py @@ -19,12 +19,16 @@ class CmdMove(CmdBase): def add_parser(subparsers, parent_parser): + MOVE_HELP = ( + "Rename or move a DVC controlled data file or a directory.\n" + "documentation: https://man.dvc.org/move" + ) description = ( "Rename or move a data file or a directory that " "is under DVC control. It renames and modifies " "the corresponding DVC file to reflect the changes." ) - help = "Rename or move a DVC controlled data file or a directory." + help = MOVE_HELP move_parser = subparsers.add_parser( "move", parents=[parent_parser], description=description, help=help ) diff --git a/dvc/command/pipeline.py b/dvc/command/pipeline.py index e9e3e6b0e..401ef4dce 100644 --- a/dvc/command/pipeline.py +++ b/dvc/command/pipeline.py @@ -137,7 +137,9 @@ class CmdPipelineList(CmdBase): def add_parser(subparsers, parent_parser): - PIPELINE_HELP = "Manage pipeline." + PIPELINE_HELP = ( + "Manage pipeline.\ndocumentation: https://man.dvc.org/pipeline" + ) pipeline_parser = subparsers.add_parser( "pipeline", parents=[parent_parser], diff --git a/dvc/command/remote.py b/dvc/command/remote.py index caf30f986..279423112 100644 --- a/dvc/command/remote.py +++ b/dvc/command/remote.py @@ -119,7 +119,10 @@ class CmdRemoteList(CmdConfig): def add_parser(subparsers, parent_parser): from dvc.command.config import parent_config_parser - REMOTE_HELP = "Manage set of tracked repositories." + REMOTE_HELP = ( + "Manage set of tracked repositories.\n" + "documentation: https://man.dvc.org/remote" + ) remote_parser = subparsers.add_parser( "remote", parents=[parent_parser], @@ -134,7 +137,9 @@ def add_parser(subparsers, parent_parser): fix_subparsers(remote_subparsers) - REMOTE_ADD_HELP = "Add remote." + REMOTE_ADD_HELP = ( + "Add remote.\ndocumentation: https://man.dvc.org/remote-add" + ) remote_add_parser = remote_subparsers.add_parser( "add", parents=[parent_config_parser, parent_parser], @@ -144,8 +149,7 @@ def add_parser(subparsers, parent_parser): remote_add_parser.add_argument("name", help="Name.") remote_add_parser.add_argument( "url", - help="URL. See full list of supported urls at " - "https://dvc.org/doc/commands-reference/remote", + help="URL. See full list of supported urls at " "man.dvc.org/remote", ) remote_add_parser.add_argument( "-d", @@ -175,7 +179,9 @@ def add_parser(subparsers, parent_parser): ) remote_default_parser.set_defaults(func=CmdRemoteDefault) - REMOTE_REMOVE_HELP = "Remove remote." + REMOTE_REMOVE_HELP = ( + "Remove remote.\ndocumentation: https://man.dvc.org/remote-remove" + ) remote_remove_parser = remote_subparsers.add_parser( "remove", parents=[parent_config_parser, parent_parser], @@ -185,7 +191,9 @@ def add_parser(subparsers, parent_parser): remote_remove_parser.add_argument("name", help="Name") remote_remove_parser.set_defaults(func=CmdRemoteRemove) - REMOTE_MODIFY_HELP = "Modify remote." + REMOTE_MODIFY_HELP = ( + "Modify remote.\ndocumentation: https://man.dvc.org/remote-modify" + ) remote_modify_parser = remote_subparsers.add_parser( "modify", parents=[parent_config_parser, parent_parser], @@ -204,7 +212,9 @@ def add_parser(subparsers, parent_parser): ) remote_modify_parser.set_defaults(func=CmdRemoteModify) - REMOTE_LIST_HELP = "List remotes." + REMOTE_LIST_HELP = ( + "List remotes.\ndocumentation: https://man.dvc.org/remote-list" + ) remote_list_parser = remote_subparsers.add_parser( "list", parents=[parent_config_parser, parent_parser], diff --git a/dvc/command/remove.py b/dvc/command/remove.py index 51ba2e40d..13faf5aa9 100644 --- a/dvc/command/remove.py +++ b/dvc/command/remove.py @@ -38,7 +38,10 @@ class CmdRemove(CmdBase): def add_parser(subparsers, parent_parser): - REMOVE_HELP = "Remove outputs of DVC file." + REMOVE_HELP = ( + "Remove outputs of DVC file.\n" + "documentation: https://man.dvc.org/remove" + ) remove_parser = subparsers.add_parser( "remove", parents=[parent_parser], diff --git a/dvc/command/repro.py b/dvc/command/repro.py index 8e582196f..b9203ffad 100644 --- a/dvc/command/repro.py +++ b/dvc/command/repro.py @@ -51,7 +51,10 @@ class CmdRepro(CmdBase): def add_parser(subparsers, parent_parser): - REPRO_HELP = "Reproduce DVC file. Default file name - 'Dvcfile'." + REPRO_HELP = ( + "Reproduce DVC file. Default file name - 'Dvcfile'.\n" + "documentation: https://man.dvc.org/repro" + ) repro_parser = subparsers.add_parser( "repro", parents=[parent_parser], diff --git a/dvc/command/root.py b/dvc/command/root.py index f43dce9e3..27d9121aa 100644 --- a/dvc/command/root.py +++ b/dvc/command/root.py @@ -16,7 +16,10 @@ class CmdRoot(CmdBase): def add_parser(subparsers, parent_parser): - ROOT_HELP = "Relative path to repo's directory." + ROOT_HELP = ( + "Relative path to repo's directory.\n" + "documentation: https://man.dvc.org/root" + ) root_parser = subparsers.add_parser( "root", parents=[parent_parser], description=ROOT_HELP, help=ROOT_HELP ) diff --git a/dvc/command/run.py b/dvc/command/run.py index 1dd99bbe5..cc9bc636e 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -75,7 +75,8 @@ class CmdRun(CmdBase): def add_parser(subparsers, parent_parser): RUN_HELP = ( "Generate a stage file from a given " - "command and execute the command." + "command and execute the command.\n" + "documentation: https://man.dvc.org/run" ) run_parser = subparsers.add_parser( "run", parents=[parent_parser], description=RUN_HELP, help=RUN_HELP diff --git a/dvc/command/unprotect.py b/dvc/command/unprotect.py index 2cc9d931d..7ab448296 100644 --- a/dvc/command/unprotect.py +++ b/dvc/command/unprotect.py @@ -18,7 +18,10 @@ class CmdUnprotect(CmdBase): def add_parser(subparsers, parent_parser): - UNPROTECT_HELP = "Unprotect data file/directory." + UNPROTECT_HELP = ( + "Unprotect data file/directory.\n" + "documentation: https://man.dvc.org/unprotect" + ) unprotect_parser = subparsers.add_parser( "unprotect", parents=[parent_parser],