From f259bc52cdb907226d64f25108dd1e90e783e2f0 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Wed, 10 Jun 2020 02:32:18 +0300 Subject: [PATCH] config/remote/cache: make --system/--global/--local mutually exclusive (#4000) --- dvc/command/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dvc/command/config.py b/dvc/command/config.py index ed2203c50..f536dd04c 100644 --- a/dvc/command/config.py +++ b/dvc/command/config.py @@ -50,21 +50,22 @@ class CmdConfig(CmdBaseNoRepo): parent_config_parser = argparse.ArgumentParser(add_help=False) -parent_config_parser.add_argument( +level_group = parent_config_parser.add_mutually_exclusive_group() +level_group.add_argument( "--global", dest="level", action="store_const", const="global", help="Use global config.", ) -parent_config_parser.add_argument( +level_group.add_argument( "--system", dest="level", action="store_const", const="system", help="Use system config.", ) -parent_config_parser.add_argument( +level_group.add_argument( "--local", dest="level", action="store_const",