From 4c388089af57cfb005e0db00fe8882131c5b8558 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 5 Dec 2017 01:03:06 -0800 Subject: [PATCH] Rename -r to -g (--out-git). Close #322 --- dvc/cli.py | 4 ++-- dvc/command/common/command_file.py | 10 +++++----- dvc/command/run.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dvc/cli.py b/dvc/cli.py index 4d4cf04bd..ba42d9f5b 100644 --- a/dvc/cli.py +++ b/dvc/cli.py @@ -103,8 +103,8 @@ def parse_args(argv=None): action='append', default=[], help='Declare output data file (sync to cloud) for reproducible cmd.') - run_parser.add_argument('-r', - '--reg', + run_parser.add_argument('-g', + '--out-git', action='append', default=[], help='Declare output regular file (sync to Git) for reproducible cmd.') diff --git a/dvc/command/common/command_file.py b/dvc/command/common/command_file.py index 62aee62e8..4008f2b85 100644 --- a/dvc/command/common/command_file.py +++ b/dvc/command/common/command_file.py @@ -9,14 +9,14 @@ class CommandFile(StateFileBase): PARAM_CMD = 'cmd' PARAM_OUT = 'out' - PARAM_REG = 'reg' + PARAM_OUT_GIT = 'out-git' PARAM_DEPS = 'deps' PARAM_LOCK = 'locked' - def __init__(self, cmd, out, reg, deps, locked, fname): + def __init__(self, cmd, out, out_git, deps, locked, fname): self.cmd = cmd self.out = out - self.reg = reg + self.out_git = out_git self.deps = deps self.locked = locked self.fname = fname @@ -26,7 +26,7 @@ class CommandFile(StateFileBase): data = { self.PARAM_CMD: self.cmd, self.PARAM_OUT: self.out, - self.PARAM_REG: self.reg, + self.PARAM_OUT_GIT: self.out_git, self.PARAM_DEPS: self.deps, self.PARAM_LOCK: self.locked } @@ -44,7 +44,7 @@ class CommandFile(StateFileBase): def loadd(data, fname=None): return CommandFile(data.get(CommandFile.PARAM_CMD, None), data.get(CommandFile.PARAM_OUT, None), - data.get(CommandFile.PARAM_REG, None), + data.get(CommandFile.PARAM_OUT_GIT, None), data.get(CommandFile.PARAM_DEPS, None), data.get(CommandFile.PARAM_LOCK, None), fname) diff --git a/dvc/command/run.py b/dvc/command/run.py index ddb00c352..193bd0cde 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -21,7 +21,7 @@ class CmdRun(CmdBase): command = CommandFile.load(cmd) except Exception as exc: Logger.debug("Failed to load {}: {}".format(cmd, str(exc))) - command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.reg, + command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.out_git, self.parsed_args.deps, self.parsed_args.lock, None) self.run_command(self.settings, command) @@ -32,7 +32,7 @@ class CmdRun(CmdBase): Executor.exec_cmd_only_success(command.cmd, shell=True) CmdRun.apply_to_files(command.out, command, CmdRun._create_cache_and_state_files, settings) - CmdRun.apply_to_files(command.reg, command, CmdRun._create_state_file, settings) + CmdRun.apply_to_files(command.out_git, command, CmdRun._create_state_file, settings) @staticmethod def apply_to_files(files, command, func, settings):