mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
- Uses a formatter for coloring output - Move the `progress_aware` decorator logic to the logger itself - Refactor modules so each one uses their own instance of a logger Close #1753
32 lines
734 B
Python
32 lines
734 B
Python
from __future__ import unicode_literals
|
|
|
|
import argparse
|
|
import os
|
|
import logging
|
|
|
|
from dvc.command.base import CmdBase, append_doc_link
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class CmdRoot(CmdBase):
|
|
def run_cmd(self):
|
|
return self.run()
|
|
|
|
def run(self):
|
|
logger.info(os.path.relpath(self.repo.root_dir))
|
|
return 0
|
|
|
|
|
|
def add_parser(subparsers, parent_parser):
|
|
ROOT_HELP = "Relative path to the repository's directory."
|
|
root_parser = subparsers.add_parser(
|
|
"root",
|
|
parents=[parent_parser],
|
|
description=append_doc_link(ROOT_HELP, "root"),
|
|
help=ROOT_HELP,
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
)
|
|
root_parser.set_defaults(func=CmdRoot)
|