home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / doc / wdiff.man < prev    next >
Text File  |  1993-06-13  |  13KB  |  397 lines

  1.  
  2.  
  3.  
  4. WDIFF(1)                                                 WDIFF(1)
  5.  
  6.  
  7. NAME
  8.        wdiff - display word differences between text files
  9.  
  10.  
  11. SYNOPSIS
  12.        wdiff [ option ...  ] old_file new_file
  13.  
  14.  
  15. COPYRIGHT
  16.        Copyright (C) 1992 by the Free Software Foundation, Inc.
  17.  
  18.  
  19. DESCRIPTION
  20.        wdiff  compares  two  files, finding which words have been
  21.        deleted or added to old_file to get new_file.  A  word  is
  22.        anything  between whitespace.  The output is collected and
  23.        used to produce an annotated copy of new_file on  standard
  24.        output.  Suitable  annotations  produce  a nice display of
  25.        word differences between the original files.
  26.  
  27.        wdiff will exit with a status of 0 if no differences  were
  28.        found,  a  status of 1 if any differences were found, or a
  29.        status of 2 for any error.
  30.  
  31.        Usually underlining is used to mark  deleted  text,  while
  32.        bold or reverse video is used to mark inserted text; these
  33.        defaults may  be  over-ridden  by  command  line  options.
  34.        deleted  text  refers  to text in old_file which is not in
  35.        new_file, while inserted text refers to text  on  new_file
  36.        which is not in old_file.
  37.  
  38.  
  39. OPTIONS
  40.        --help Has the same effect as -h.
  41.  
  42.        -h     Print  an  informative  help message describing the
  43.               options.
  44.  
  45.        --version
  46.               Has the same effect as -v.
  47.  
  48.        -v     Print the version number of wdiff on  the  standard
  49.               error output.
  50.  
  51.        --no-deleted
  52.               Has the same effect as -1.
  53.  
  54.        -1     Avoid  producing  deleted  words  on the output. If
  55.               neither -1 or -2 is selected,  the  original  right
  56.               margin may be exceeded for some lines.
  57.  
  58.        --no-inserted
  59.               Has the same effect as 2.
  60.  
  61.  
  62.  
  63.  
  64. GNU                         1992/12/21                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. WDIFF(1)                                                 WDIFF(1)
  71.  
  72.  
  73.        -2     Avoid  producing  inserted  words on the output. If
  74.               neither -1 or -2 is selected,  the  original  right
  75.               margin may be exceeded for some lines.
  76.  
  77.        --no-common
  78.               Has the same effect as -3.
  79.  
  80.        -3     Avoid  producing  common words on the output.  When
  81.               this option  is  not  selected,  common  words  and
  82.               whitespace are taken from new_file.  When selected,
  83.               differences are separated from one another by lines
  84.               of dashes.  Moreover, if this option is selected at
  85.               the same time as -1 or -2, then none of the  output
  86.               will  have any emphasis - i.e. no bold or underlin-
  87.               ing.  Finally, if this option is not selected,  but
  88.               both  -1  and -2 are, then sections of common words
  89.               between  differences  are  separated  by  lines  of
  90.               dashes.
  91.  
  92.  
  93.        --statistics
  94.               Has the same effect as -s.
  95.  
  96.        -s     On  completion,  for each file, the total number of
  97.               words, the  number  of  common  words  between  the
  98.               files,  the number of words deleted or inserted and
  99.               the number of words that have changed is output. (A
  100.               changed  word  is  one that has been replaced or is
  101.               part of a replacement.)  Except for the total  num-
  102.               ber  of words, all of the numbers are followed by a
  103.               percentage relative to the total number of words in
  104.               the file.
  105.  
  106.  
  107.        --auto-pager
  108.               Has the same effect as -a.
  109.  
  110.        -a     A  pager is interposed whenever the wdiff output is
  111.               directed to  the  user's  terminal.   Without  this
  112.               option,  no  pager will be called; the user is then
  113.               responsible for explicitly piping wdiff output into
  114.               a pager if required.
  115.  
  116.               The  pager  is  selected  by the value of the PAGER
  117.               environment variable when wdiff is run.   If  PAGER
  118.               is  not  defined at run time, then a default pager,
  119.               selected  at  installation  time,  will   be   used
  120.               instead.   A defined but empty value of PAGER means
  121.               no pager at all.
  122.  
  123.               When a pager is interposed through the use of  this
  124.               option,  one  of  the  options  -l  or  -t  is also
  125.               selected, depending on whether  the  string  "less"
  126.               appears in the pager's name or not.
  127.  
  128.  
  129.  
  130. GNU                         1992/12/21                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. WDIFF(1)                                                 WDIFF(1)
  137.  
  138.  
  139.               It  is often useful to define wdiff as an alias for
  140.               wdiff -a.  However, this "hides" the  normal  wdiff
  141.               behaviour.  The  default  behaviour may be restored
  142.               simply by piping the output from wdiff through cat.
  143.               This dissociates the output from the user terminal.
  144.  
  145.  
  146.        --printer
  147.               Has the same effect as -p.
  148.  
  149.        -p     Use over-striking to emphasize parts of the output.
  150.               Each character of the deleted text is underlined by
  151.               writing an underscore _ first, then a backspace and
  152.               then  the  letter to be underlined.  Each character
  153.               of the inserted text is emboldened  by  writing  it
  154.               twice, with a backspace in between.  This option is
  155.               not selected by default.
  156.  
  157.  
  158.        --less-mode
  159.               Has the same effect as -l.
  160.  
  161.        -l     Use over-striking to  emphasize  parts  of  output.
  162.               This  option  works  as  option  -p, but also over-
  163.               strikes whitespace associated with  inserted  text.
  164.               less  shows  such  whitespace  using reverse video.
  165.               This option is not selected by  default.   However,
  166.               it   is  automatically  turned  on  whenever  wdiff
  167.               launches less.  (See option -a.)
  168.  
  169.               This option is commonly used  in  conjunction  with
  170.               less:
  171.  
  172.               wdiff -l old_file new_file | less
  173.  
  174.  
  175.        --terminal
  176.               Has the same effect as -t.
  177.  
  178.        -t     Force  the production of termcap strings for empha-
  179.               sising parts of output, even if the standard output
  180.               is  not associated with a terminal.  The TERM envi-
  181.               ronment variable must contain the name of  a  valid
  182.               termcap entry. If the terminal description permits,
  183.               underlining is used for marking deleted text, while
  184.               bold  or reverse video is used for marking inserted
  185.               text.  This option  is  not  selected  by  default.
  186.               However,  it  is  automatically  turned on whenever
  187.               wdiff launches a pager, and it is  known  that  the
  188.               pager is not less.  (See option -a.)
  189.  
  190.               This  option  is commonly used when wdiff output is
  191.               not redirected, but sent  directly  to  the  user's
  192.               terminal, as in:
  193.  
  194.  
  195.  
  196. GNU                         1992/12/21                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. WDIFF(1)                                                 WDIFF(1)
  203.  
  204.  
  205.               wdiff -t old_file new_file
  206.  
  207.               A  common kludge uses wdiff together with the pager
  208.               more, as in:
  209.  
  210.               wdiff -t old_file new_file | more
  211.  
  212.  
  213.               However, some versions of more use termcap emphasis
  214.               for their own purposes, so strange interactions are
  215.               possible.
  216.  
  217.  
  218.        --start-delete argument
  219.               Has the same effect as -w.
  220.  
  221.        -w argument
  222.               Use argument as the "start  delete"  string.   This
  223.               string  will  be  output prior to every sequence of
  224.               deleted text, to mark where it starts.  By default,
  225.               no  start  delete string is used unless there is no
  226.               other  means  of  distinguishing  where  such  text
  227.               starts;  in  this  case  the  default  start delete
  228.               string is [-.
  229.  
  230.  
  231.        --end-delete argument
  232.               Has the same effect as -x.
  233.  
  234.        -x argument
  235.               Use argument as  the  "end  delete"  string.   This
  236.               string  will  be  output  after  every  sequence of
  237.               deleted text, to mark where it ends.   By  default,
  238.               no  end  delete  string  is used unless there is no
  239.               other means of distinguishing where such text ends;
  240.               in this case the default end delete string is -].
  241.  
  242.  
  243.        --start-insert argument
  244.               Has the same effect as -y.
  245.  
  246.        -y argument
  247.               Use  argument  as  the "start insert" string.  This
  248.               string will be output  prior  to  any  sequence  of
  249.               inserted   text,  to  mark  where  it  starts.   By
  250.               default, no start  insert  string  is  used  unless
  251.               there  is  no  other  means of distinguishing where
  252.               such text starts; in this case  the  default  start
  253.               insert string is {+.
  254.  
  255.  
  256.        --end-insert argument
  257.               Has the same effect as -z.
  258.  
  259.  
  260.  
  261.  
  262. GNU                         1992/12/21                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. WDIFF(1)                                                 WDIFF(1)
  269.  
  270.  
  271.        -z argument
  272.               Use  argument  as  the  "end  insert" string.  This
  273.               string  will  be  output  after  any  sequence   of
  274.               inserted  text, to mark where it ends.  By default,
  275.               no end insert string is used  unless  there  is  no
  276.               other means of distinguishing where such text ends;
  277.               in this case the default end insert string is +}.
  278.  
  279.  
  280.        --avoid-wraps
  281.               Has the same effect as -n.
  282.  
  283.        -n     Avoid  spanning  the  end  of  line  while  showing
  284.               deleted  or  inserted text.  Any single fragment of
  285.               deleted or inserted text spanning many  lines  will
  286.               be  considered  as  being  made  up of many smaller
  287.               fragments not containing  a  newline.   So  deleted
  288.               text,  for  example, will have an end delete string
  289.               at the end of each line, just before the new  line,
  290.               and  a  start delete string at the beginning of the
  291.               next line.  A long paragraph of inserted text  will
  292.               have  each  line bracketed between start insert and
  293.               end insert strings.  This behaviour is not selected
  294.               by default.
  295.  
  296.  
  297.  
  298.        Note  that  options  -p,  -t, and -[wxyz] are not mutually
  299.        exclusive. If you use a  combination  of  them,  you  will
  300.        merely  accumulate  the  effect  of  each.  Option -l is a
  301.        variant of option -p.
  302.  
  303.  
  304. EXAMPLES
  305.        The following command produces a copy of new_file, shifted
  306.        right  one space to accommodate change bars since the last
  307.        revision, ignoring those changes coming  only  from  para-
  308.        graph  refilling.   Any line with new or changed text will
  309.        get a | in column 1. However, deleted text  is  not  shown
  310.        nor marked.
  311.  
  312.        wdiff  -1n  old_file  new_file  |  sed  -e 's/^/ /;/{+/s/^
  313.        /|/;s/{+//g;s/+}//g'
  314.  
  315.  
  316.  
  317. BUGS
  318.        If you find a bug in wdiff, please send electronic mail to
  319.        pinard@iro.umontreal.ca.    Include  the  version  number,
  320.        which you can find by running wdiff --version.  Include in
  321.        your message sufficient input to reproduce the problem and
  322.        also, the output you expected.
  323.  
  324.        wdiff currently calls diff.  wdiff would  be  quicker  and
  325.  
  326.  
  327.  
  328. GNU                         1992/12/21                          5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. WDIFF(1)                                                 WDIFF(1)
  335.  
  336.  
  337.        cleaner  to implement if it were part of the diff suite of
  338.        programs.
  339.  
  340.        Here are some (un-processed) suggestions:
  341.  
  342.        -      Make an MS-DOS port.
  343.  
  344.        -      Select by options exactly what is whitespace.
  345.  
  346.        -      Have a wpatch program.  Hard to see a good  way  of
  347.               doing this.
  348.  
  349.  
  350.  
  351. IDENTIFICATION
  352.        Author: Francois Pinard, pinard@iro.umontreal.ca
  353.        Manual Page: Colin M. Brough, cmb@epcc.ed.ac.uk
  354.        Revision Number: 0.4; Release Date: 1992/12/21.
  355.  
  356.  
  357. SEE ALSO
  358.        diff(1), less(1), cat(1), more(1), termcap(3).
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. GNU                         1992/12/21                          6
  395.  
  396.  
  397.