mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
diff: --json -> --show-json
This commit is contained in:
+2
-2
@@ -86,7 +86,7 @@ class CmdDiff(CmdBase):
|
||||
if not any(diff.values()):
|
||||
return 0
|
||||
|
||||
if self.args.json:
|
||||
if self.args.show_json:
|
||||
res = json.dumps(diff)
|
||||
else:
|
||||
res = self._format(diff, include_checksums=self.args.checksums)
|
||||
@@ -136,7 +136,7 @@ def add_parser(subparsers, parent_parser):
|
||||
),
|
||||
)
|
||||
diff_parser.add_argument(
|
||||
"--json",
|
||||
"--show-json",
|
||||
help="Format the output into a JSON",
|
||||
action="store_true",
|
||||
default=False,
|
||||
|
||||
@@ -22,7 +22,7 @@ _dvc_checkout='-d --with-deps -R --recursive -f --force --relink $(compgen -G *.
|
||||
_dvc_commit='-f --force -d --with-deps -R --recursive $(compgen -G *.dvc)'
|
||||
_dvc_config='-u --unset --local --system --global'
|
||||
_dvc_destroy='-f --force'
|
||||
_dvc_diff='-t --target --json --checksums'
|
||||
_dvc_diff='-t --target --show-json --checksums'
|
||||
_dvc_fetch='-j --jobs -r --remote -a --all-branches -T --all-tags -d --with-deps -R --recursive $(compgen -G *.dvc)'
|
||||
_dvc_get_url=''
|
||||
_dvc_get='-o --out --rev --show-url'
|
||||
|
||||
@@ -98,7 +98,7 @@ _dvc_destroy=(
|
||||
|
||||
_dvc_diff=(
|
||||
{-t,--target}"[Source path to a data file or directory.]:Target files:"
|
||||
"--json[Format the output into a JSON]"
|
||||
"--show-json[Format the output into a JSON]"
|
||||
"--checksums[Display checksums for each entry]"
|
||||
{1,2}":Git revision (e.g. branch, tag, SHA):"
|
||||
)
|
||||
|
||||
@@ -46,7 +46,7 @@ def test_checksums(mocker, caplog):
|
||||
|
||||
|
||||
def test_json(mocker, caplog):
|
||||
args = parse_args(["diff", "--json"])
|
||||
args = parse_args(["diff", "--show-json"])
|
||||
cmd = args.func(args)
|
||||
diff = {
|
||||
"added": [{"filename": "file", "checksum": "00000000"}],
|
||||
|
||||
Reference in New Issue
Block a user