|
NAMEmgdiff - Motif-based graphical file difference browserSYNOPSISmgdiff [-toolkitoption ...] [-quit] [-file name] [-args diffargs] [file1 file2]DESCRIPTIONMgdiff is a graphical front end to the diff command. It permits the user to view the differences between two ASCII files in context and, optionally, to write out a third file which is the user-defined merging of those two files. It is inspired by a similar program, called gdiff, which runs only on Silicon Graphics workstations and for which source code is not provided.The program takes as arguments various flags (described in the next section) and the names of two files to compare. Either filename (but not both) may be given as '-' to use standard input instead. The resulting display consists mostly of two panes of text; the one on the left is the first file specified and the one on the right is the second file specified. Between and below the text panes are scrollbars that permit changing the visible portions of the two files being compared. In addition, the program implements the Scrolled Region recommendations of Section 2.3.4 of the OSF/Motif Style Guide (release 1.1), meaning that the arrow and paging keys will work to scroll as well. Above each text pane is the name of the file in that text pane and the line number in the file which is being displayed. The text in each of the text panes is divided into blocks of lines which are color-coded with one of five different colors. This indicates that the block:
These colors can be modified by the user via X resources; see the RESOURCES section of this manual page. A legend display of the colors and their meanings is available using the Help menu. On the right-hand side of the display is an overview area; this shows the files in their entirety. The sliders in the overview area track the lines being displayed in the text panes. At the top of the display is a Motif menu bar; those functions are discussed in the MENUS section of this manual page. COMMAND LINE OPTIONS
MENUSThe menubar contains the following menu topics as CascadeButtons: File, View, Select, Options and Help. The rest of this section discusses each menu entry, showing it's name and accelerator, if any.
This pulldown menu controls file access:
Brings up the "Open Files" FileSelectionDialog to allow the user to open two files for comparison.
Brings up the "Open File" FileSelectionDialog to allow the user to specify a file to open and compare with the already opened right-hand file.
Brings up the "Open File" FileSelectionDialog to allow the user to specify a file to open and compare with the already opened left-hand file.
Brings up the "Save File" FileSelectionDialog to allow the user to specify an output file for writing the merged file; this is an application modal dialog. The program will allow the user to overwrite an existing file but pops up a QuestionDialog to allow the user to cancel the operation if desired. If there are any unselected areas of difference between the two files the user is notified via an ErrorDialog and the save operation is canceled.
Exits the program immediately.
This pulldown menu contains commands for moving through the files.
Scrolls both file views so that the previous area of difference is Mgdiff.linesOfContext lines from the top of the application window.
Scrolls both file views so that the next area of difference is Mgdiff.linesOfContext lines from the top of the application window.
Scrolls both file views so that the next unselected area of difference is Mgdiff.linesOfContext lines from the top of the application window.
The two files being compared can be optionally merged into one file. To do this, the user must select for each area of difference between the two files which version should be written to the merged file. The menu entries in this pulldown menu allow the user to select or unselect differences in groups rather than individually.
For all areas of difference between the two files select the left-hand file version.
For all areas of difference between the two files select the right-hand file version.
Unselects all areas of difference in both files.
This pulldown menu controls miscellaneous appearance and/or behavior options.
This menu entry toggles the presence of the overview area on the right-hand side of the application window. The default value for this toggle is controlled by a resource, Mgdiff.overview, which is described in the RESOURCES section.
This menu entry toggles the presence of the horizontal scrollbar at the bottom of the application window. The default value for this toggle is controlled by a resource, Mgdiff.horzScrollbar, which is described in the RESOURCES section.
This menu entry toggles the behaviour of the scrollbars in the application window. When set, dragging the slider of a scrollbar results in a immediate change in the view of the text being compared. When unset, the view is only changed at the end of a slider drag (when the mouse button is released.) This setting might be preferred on a slower X server. The default value for this toggle is controlled by a resource, Mgdiff.dragScroll, which is described in the RESOURCES section.
This pulldown menu displays commands for obtaining help on or information about mgdiff.
Brings up an InformationDialog with author and version information.
Brings up a DialogShell with a ScrolledText widget containing this manual page. The command for generating this is customizable via a resource, Mgdiff.manCommand, which is described in the RESOURCES section.
Brings up a DialogShell which summarizes the use of color in encoding the types of differences between the two files being compared. OTHER DISPLAYS/CONTROLSYou can move directly to a particular spot in the two files by using BDrag in the overview area.The program uses what the OSF/Motif Style Guide calls "multiple selection" to select individual blocks for writing to a merged file. Clicking BSelect on an unselected block adds it to the list of selected blocks. Clicking BSelect on a selected block removes it from the list of selected blocks. In addition, Clicking BSelect on an unselected block which is opposite a selected block (in the other text panes) removes the selected block from the list of selected blocks. The numbers in the small boxes next to the file names are the line numbers of the lines at the top of the text panes. WIDGETSWhat follows is the hierarchy of Motif widgets, as generated by editres(1). The hierarchical structure of the widget tree is reflected in the indentation. Each line consists of the widget class name followed by the widget instance name. This information might be useful if you wish to customize the appearance of the program via resource settings.Mgdiff mgdiff XmMainWindow mainw XmSeparatorGadget MainWinSep1 XmSeparatorGadget MainWinSep2 XmSeparatorGadget MainWinSep3 XmRowColumn menubar XmCascadeButtonGadget button_0 XmCascadeButtonGadget button_1 XmCascadeButtonGadget button_2 XmCascadeButtonGadget button_3 XmCascadeButtonGadget button_4 XmMenuShell popup_file_menu XmRowColumn select_menu XmPushButtonGadget button_0 XmPushButtonGadget button_1 XmSeparatorGadget separator_0 XmPushButtonGadget button_2 XmRowColumn file_menu XmPushButtonGadget button_0 XmPushButtonGadget button_1 XmPushButtonGadget button_2 XmPushButtonGadget button_3 XmSeparatorGadget separator_0 XmPushButtonGadget button_4 XmRowColumn options_menu XmToggleButtonGadget button_0 XmToggleButtonGadget button_1 XmToggleButtonGadget button_2 XmRowColumn help_menu XmPushButtonGadget button_0 XmPushButtonGadget button_1 XmPushButtonGadget button_2 XmRowColumn view_menu XmPushButtonGadget button_0 XmPushButtonGadget button_1 XmPushButtonGadget button_2 XmForm form1 XmFrame frame1 XmForm form3 XmScrollBar sbl XmDrawingArea dam XmScrollBar sbr XmFrame frame2 XmForm form4 XmForm form2 XmScrollBar sb XmForm form21 XmFrame frame3 XmLabel fnamel XmFrame frame31 XmTextField linenuml XmForm form22 XmFrame frame4 XmLabel fnamer XmFrame frame41 XmTextField linenumr XmDrawingArea textl XmDrawingArea textr XmScrollBar sbh XmDialogShell version_popup XmMessageBox version XmLabelGadget symbol XmLabelGadget XmSeparatorGadget separator XmPushButtonGadget OK XmPushButtonGadget Cancel XmPushButtonGadget Help XmDialogShell manualpage_popup XmForm manualpage XmPanedWindow pane XmScrolledWindow help_textSW XmScrollBar vbar XmText help_text XmForm form2a XmPushButton OK XmSash sash XmSeparatorGadget separator XmSash sash XmSeparatorGadget separator XmDialogShell legend_popup XmForm legend XmPanedWindow pane XmRowColumn rc XmLabel label1 XmLabel label2 XmLabel label3 XmLabel label4 XmLabel label5 XmForm form2a XmPushButton OK XmSash sash XmSeparatorGadget separator XmSash sash XmSeparatorGadget separator XmDialogShell werror_popup XmMessageBox werror XmLabelGadget symbol XmLabelGadget XmSeparatorGadget separator XmPushButtonGadget OK XmPushButtonGadget Cancel XmPushButtonGadget Help X RESOURCES
These colors are for blocks which differ between files.
These colors are for blocks which are identical between files.
These colors are for blocks which have been inserted in one file.
These colors are for blocks which are for display purposes.
These colors are for blocks which have been selected by the user.
Font for displaying text blocks.
Set to true if scrollbar dragging should cause immediate changes in the viewed text, and false if the view should only change after the scrollbar has been moved.
Set to true if the file overview section should appear.
Set to true if the horizontal scrollbar should appear.
Number of lines that should appear above a difference block gotten to using the Previous or Next commands. Should be greater or equal to zero.
The command (or pipeline) used to produce a formatted manual page without escape codes.
The diff(1) compatible command to use for calculating differences between text files.
The arguments to be provided to the diff command. This resource can also be set via the -args command line option.
If the two files have no differences (as determined by the diff command) then exit immediately without bringing up a window. This resource can also be set to "true" via the -quit command line option.
mgdiff uses this string to display over a file read from standard input. This resource can also be set via the -file command line option. DIAGNOSTICSReturns the exit status generated by the diff command. This is usually 0 for no differences, 1 for some differences and 2 for errors.SEE ALSOdiff(1), X(1)RESTRICTIONSUsing BDrag in the overview area doesn't work well when drag scrolling is turned off.Doesn't support monochrome displays. Input lines longer than BUFSIZ (see /usr/include/stdio.h) are silently truncated. The code for parsing and passing arguments to the diff command assumes arguments are delimited by white space and does not do any quote processing. COPYRIGHTCopyright (c) 1994, Daniel WilliamsSee X (1) for a full statement of rights and permissions. AUTHORDaniel Williams (dan@sass.com)ACKNOWLEDGEMENTSTo Andrew C. Myers for writing gdiff. Visit the GSP FreeBSD Man Page Interface. |