diff --git a/dvc/command/remote.py b/dvc/command/remote.py index 7d3ce773f8..2eaf9a82bf 100644 --- a/dvc/command/remote.py +++ b/dvc/command/remote.py @@ -5,6 +5,7 @@ from dvc.command.base import fix_subparsers from dvc.command.config import CmdConfig from dvc.remote.config import RemoteConfig +from dvc.utils import format_link logger = logging.getLogger(__name__) @@ -99,7 +100,9 @@ def add_parser(subparsers, parent_parser): remote_add_parser.add_argument("name", help="Name of the remote") remote_add_parser.add_argument( "url", - help="URL. See full list of supported urls at " "man.dvc.org/remote", + help="URL. See full list of supported urls at {}".format( + format_link("https://man.dvc.org/remote") + ), ) remote_add_parser.add_argument( "-d", diff --git a/dvc/dagascii.py b/dvc/dagascii.py index 49cfb2f7cc..f19f94148c 100644 --- a/dvc/dagascii.py +++ b/dvc/dagascii.py @@ -14,7 +14,7 @@ from grandalf.routing import route_with_lines from dvc.env import DVC_PAGER - +from dvc.utils import format_link logger = logging.getLogger(__name__) @@ -45,7 +45,9 @@ def find_pager(): logger.warning( "Unable to find `less` in the PATH. Check out " - "man.dvc.org/doc/command-reference/pipeline/show for more info." + "{} for more info.".format( + format_link("https://man.dvc.org/pipeline/show") + ) ) return pydoc.plainpager diff --git a/dvc/exceptions.py b/dvc/exceptions.py index c40677170e..cc81ec7ad2 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -1,6 +1,6 @@ """Exceptions raised by the dvc.""" -from dvc.utils import relpath +from dvc.utils import relpath, format_link class DvcException(Exception): @@ -244,9 +244,10 @@ def __init__(self, ignore_dirname): class GitHookAlreadyExistsError(DvcException): def __init__(self, hook_name): super().__init__( - "Hook '{}' already exists. Please refer to " - "https://man.dvc.org/install " - "for more info.".format(hook_name) + "Hook '{}' already exists. Please refer to {} for more " + "info.".format( + hook_name, format_link("https://man.dvc.org/install") + ) ) diff --git a/dvc/remote/gdrive.py b/dvc/remote/gdrive.py index 24d65aa256..b9788ad02a 100644 --- a/dvc/remote/gdrive.py +++ b/dvc/remote/gdrive.py @@ -13,7 +13,7 @@ from dvc.remote.base import RemoteBASE from dvc.config import Config from dvc.exceptions import DvcException -from dvc.utils import tmp_fname +from dvc.utils import tmp_fname, format_link logger = logging.getLogger(__name__) FOLDER_MIME_TYPE = "application/vnd.google-apps.folder" @@ -93,7 +93,7 @@ def init_drive(self): raise DvcException( "Please specify Google Drive's client id and " "secret in DVC's config. Learn more at " - "https://man.dvc.org/remote/add." + "{}.".format(format_link("https://man.dvc.org/remote/add")) ) self.gdrive_user_credentials_path = ( tmp_fname(os.path.join(self.repo.tmp_dir, ""))