CLICommands
diffLast updated on
Last updated on
Compare two artifacts
Shows differences between two artifact files.
Usage
paradoc diff <file1> <file2> [options]Arguments
| Argument | Description |
|---|---|
file1 | First artifact file to compare |
file2 | Second artifact file to compare |
Options
| Option | Description |
|---|---|
--name-only | Print the paths of the two files when they differ, and nothing when they are identical (no content diff) |
Description
The diff command compares two artifact files and displays the differences in unified diff format. It attempts to parse both files as artifacts to show artifact names in the output.
Exit status
Like POSIX diff, the exit status tells scripts and agents whether the files differ, without reading the output:
| Status | Meaning |
|---|---|
0 | The files are identical |
1 | The files differ |
2 | An error occurred, such as a missing file |
Examples
Compare two files:
paradoc diff form-v1.yaml form-v2.yamlCheck if files differ in a script:
paradoc diff form-v1.yaml form-v2.yaml --name-only > /dev/null
case $? in
0) echo "unchanged" ;;
1) echo "form changed" ;;
*) echo "diff failed" ;;
esacOutput
When files differ:
--- lease-agreement (form)
+++ lease-agreement (form)
@@ -5,7 +5,7 @@
version: 1.0.0
title: Residential Lease Agreement
fields:
- monthlyRent:
+ rentAmount:
type: money
label: Monthly Rent
required: trueWhen files are identical:
Files are identicalWith --name-only, when files differ:
form-v1.yaml
form-v2.yamlSee also
The output is a human-readable unified-diff display. Its annotated file headers are not an input format for paradoc apply; use git diff or diff -u to create an applicable patch.