alexp11223/gendiff

hexlet.io项目2

0.6.0 2019-10-13 14:51 UTC

This package is auto-updated.

Last update: 2024-09-14 02:00:49 UTC


README

Build Status Maintainability Test Coverage

gendiff

比较两个JSON、YAML文件,并以不同的格式显示它们之间的差异:prettyplainjson

安装

  • 安装PHP 7.2+和Composer
  • 运行composer global require alexp11223/gendiff
  • 确保Composer全局bin目录(composer global config bin-dir --absolute)已添加到您的PATH

asciicast

用法

gendiff [--format <fmt>] <firstFile> <secondFile>

示例

gendiff before.json after.json
gendiff before.yaml after.yaml
gendiff before.json after.yaml
gendiff before.json after.json --format plain
gendiff before.json after.json --format json

pretty

类似于diff的人可读的JSON-like格式。

平面文件

asciicast

嵌套对象

asciicast

plain

对变更的文本描述。

asciicast

json

描述变更的JSON树,用于自动化处理。

asciicast