Ways to open a comparison
Every route below ends in one of a few tabs: a File Compare, a Compare Summary, a three-way merge or a Line Compare. They differ in what you hand over and in how much you see before anything runs.
| Route | What it takes | What it opens | Choose it when |
|---|---|---|---|
| File ▸ New Comparison, also on the Compare menu (Ctrl+N, tool bar New) | Two files, two library entries or two libraries; or three files | A File Compare; a Compare Summary for two libraries; a three-way merge for three files | One object, or one merge, when you want to see both paths and the kind of comparison before it runs. See New Comparison. |
| File ▸ New File Selection | Two lists of files, folders and libraries | A Compare Summary, or a File Compare when each list holds one file | Many objects at once, two folders, a folder against a library, or a selection you will save and repeat. See File Selection. |
| File ▸ Open Selection | A saved .pbdiff-sel file |
A File Selection tab holding it, to check or edit before Compare | You repeat or adjust a comparison you saved. A double-click on the file in Explorer compares it at once. |
| File ▸ Recent | A comparison started before: a pair, a folder pair, a saved selection or a three-way merge | That comparison again, as it was | You come back to it. Clear Recent List at the bottom empties the list. |
| File ▸ Open Library (Ctrl+O, tool bar Open) | One library | The library, to browse, validate and export; not a comparison | You want to see what a library holds before comparing it. See Library. |
| File ▸ Open Saved Report | A report saved as JSON | The report, as it was saved | You read a report again, or one somebody sent you. See Reports. |
| Compare ▸ Line Compare, Compare ▸ Clipboard Compare | Two pieces of text | A Line Compare tab | Two lines or two snippets that are not files. See Line Compare and Clipboard Compare. |
| A drop on the window | One saved selection, one library, two files or folders, or three files | A saved selection compared (loaded instead when dropped on a File Selection); a library to browse; two paths compared; three files in New Comparison, set to three-way, to confirm which is the Base | The files are in front of you in Explorer. |
| The command line | Paths and switches | See The desktop command line | A shortcut, a script, a source-control client or the PowerBuilder IDE starts pb-diff. |
New Comparison and a File Selection overlap on purpose: New Comparison is for one pair and shows what it is about to compare; a File Selection is for sets, and for anything with a folder in it. A drop of two paths compares them at once; a drop of three stops in New Comparison, because the order Windows hands them over in is not the order you picked them in, and a merge needs to know which file is the Base.
The same comparisons from a command line
Each route that compares files has a command-line form, in the desktop application and without a window:
| Comparison | pb-diff.exe |
pb-diff-cli.exe |
|---|---|---|
| Two files | pb-diff.exe old.srw new.srw |
pb-diff-cli compare old.srw new.srw --format json |
| Two libraries | pb-diff.exe old.pbl new.pbl |
pb-diff-cli compare-lib old.pbl new.pbl --format json |
| Two folders | pb-diff.exe release-1.4 release-1.5 |
none: the CLI compares files and libraries |
| A three-way merge | pb-diff.exe -Mode ThreeWay -File1 mine.sru -Base base.sru -File2 theirs.sru |
pb-diff-cli merge3 mine.sru base.sru theirs.sru --format json |
| A saved selection | pb-diff.exe release.pbdiff-sel |
none |
| What a library holds | none | pb-diff-cli list orders.pbl --format json |