Diff Command

James Titcumb edited this page Aug 15, 2013 · 1 revision

The diff tool contained within Browscap is designed to compare two Browscap INI files. It sorts the INI file first, and it will ignore any "formatting" differences (for example in php_browscap.ini, double-quotes are used; these are ignored).

Usage (for example to check an old version of a file against one you have generated to see what has changed):

$ bin/browscap diff build/browscap.ini build/browscap2.ini 
The following differences have been found:

[Chrome 24.0]
"IFrames" is only on the LEFT
"Frames" is only on the RIGHT

[Chrome 25.0]
"Comment" differs (L / R): Chrome 25.1 / Chrome 25.2

[Mozilla/5.0 (*Windows NT 6.2*) AppleWebKit/* (KHTML, like Gecko)*Chrome/24.0 Safari/*]
"Parent" is only on the LEFT

[Mozilla/5.0 (*Windows NT 6.2*) AppleWebKit/* (KHTML, like Gecko)*Chrome/25.0 Safari/*]
Whole section only on LEFT

[Mozilla/5.0 (*Linux i686*) AppleWebKit/* (KHTML, like Gecko)*Chrome/25.0 Safari/*]
Whole section only on RIGHT

There were 6 differences found in the comparison.
$

If both files match (even if sections are in a different order, or with different quote styles etc.), you'll see something like this:

$ bin/browscap diff build/browscap.ini build/browscap2.ini 
No differences found, hooray!
$