diff --git a/dvc/cli.py b/dvc/cli.py index cfbd99356..09f5fd5d1 100644 --- a/dvc/cli.py +++ b/dvc/cli.py @@ -16,7 +16,7 @@ from dvc.command.gc import CmdGC from dvc.command.add import CmdAdd from dvc.command.config import CmdConfig from dvc.command.checkout import CmdCheckout -from dvc.command.remote import CmdRemoteAdd, CmdRemoteRemove +from dvc.command.remote import CmdRemoteAdd, CmdRemoteRemove, CmdRemoteModify from dvc.stage import Stage from dvc import VERSION @@ -275,6 +275,28 @@ def parse_args(argv=None): remote_remove_parser.set_defaults(func=CmdRemoteRemove) + remote_modify_parser = remote_subparsers.add_parser( + 'modify', + parents=[parent_parser], + help='Modify remote') + remote_modify_parser.add_argument( + 'name', + help='Name') + remote_modify_parser.add_argument( + 'option', + help='Option') + remote_modify_parser.add_argument( + 'value', + nargs='?', + help='Value') + remote_modify_parser.add_argument('-u', + '--unset', + default=False, + action='store_true', + help='Unset option') + remote_modify_parser.set_defaults(func=CmdRemoteModify) + + args = parser.parse_args(argv) return args diff --git a/dvc/command/remote.py b/dvc/command/remote.py index a822b36e4..48c0dd853 100644 --- a/dvc/command/remote.py +++ b/dvc/command/remote.py @@ -13,3 +13,10 @@ class CmdRemoteRemove(CmdConfig): def run(self): section = Config.SECTION_REMOTE_FMT.format(self.args.name) return self.unset(section, Config.SECTION_REMOTE_URL) + + +class CmdRemoteModify(CmdConfig): + def run(self): + section = Config.SECTION_REMOTE_FMT.format(self.args.name) + self.args.name = '{}.{}'.format(section, self.args.option) + return super(CmdRemoteModify, self).run()