Skip to content

Commit

Permalink
diff: --json -> --show-json
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr. Outis committed Jan 27, 2020
1 parent 2370cb1 commit fced171
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dvc/command/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run(self):
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)
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion scripts/completion/dvc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion scripts/completion/dvc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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):"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}],
Expand Down

0 comments on commit fced171

Please sign in to comment.