This utility compares two configuration files and outputs the results in various formats.
- Support for Multiple Input Formats: The utility can handle configuration files in both YAML(YML) and JSON formats.
- Report Generation: Generate comparison reports in various formats:
- Plain: A straightforward text representation of the differences.
- Stylish: A visually appealing format that highlights changes.
- JSON: A structured output in JSON format for easy parsing.
- Composer: >= 2.2
- PHP: >= 8.1
$ git clone https://github.com/GitUserMaxim/php-project-48
$ make install gendiff (-h|--help)
gendiff (-v|--version)
gendiff [--format <fmt>] <firstFile> <secondFile>
Options:
-h --help Show this screen
-v --version Show version
--format <fmt> Report format [default: stylish]
Format options:
You can specify the output format using the --format option. The available formats are:
- stylish: A visually appealing format that highlights changes.
- plain: A straightforward text representation of the differences.
- json: A structured output in JSON format for easy parsing.
Example:
$ ./bin/gendiff tests/fixtures/file1.json tests/fixtures/file4.yaml --format json
Comparing two nested json files
$ ./bin/gendiff file1.json file2.json
Сomparison of different formats
./bin/gendiff tests/fixtures/file1.json tests/fixtures/file4.yaml --format json