mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
config: temporarily forbid --show-origin without level (#5184)
This commit is contained in:
@@ -43,6 +43,12 @@ class CmdConfig(CmdBaseNoRepo):
|
||||
"options: -u/--unset, value"
|
||||
)
|
||||
return 1
|
||||
if not self.args.level:
|
||||
logger.error(
|
||||
"--show-origin requires one of these options: "
|
||||
"--system, --global, --repo, --local"
|
||||
)
|
||||
return 1
|
||||
|
||||
if self.args.list:
|
||||
if any((self.args.name, self.args.value, self.args.unset)):
|
||||
|
||||
@@ -261,14 +261,16 @@ def test_config_show_origin(tmp_dir, dvc, caplog):
|
||||
)
|
||||
|
||||
caplog.clear()
|
||||
assert main(["config", "--show-origin", "remote.myremote.url"]) == 0
|
||||
assert (
|
||||
main(["config", "--show-origin", "--repo", "remote.myremote.url"]) == 0
|
||||
)
|
||||
assert (
|
||||
"{}\t{}\n".format(os.path.join(".dvc", "config"), "s3://bucket/path")
|
||||
in caplog.text
|
||||
)
|
||||
|
||||
caplog.clear()
|
||||
assert main(["config", "--list", "--show-origin"]) == 0
|
||||
assert main(["config", "--list", "--repo", "--show-origin"]) == 0
|
||||
assert (
|
||||
"{}\t{}\n".format(
|
||||
os.path.join(".dvc", "config"),
|
||||
|
||||
Reference in New Issue
Block a user