MVIEW(1)

NAME
mview - view files, expanding attributes

SYNOPSIS
mview [-znTcyreV] [-l N] [-d LDB] [-f FILE] [+N] file...
mview -m [-n] FILE
mview -L [-n] DIRECTORY mview --version
mview --help

DESCRIPTION
mview shows each of the given files in a full-screen viewer similar to the normal BBS file reader; it assumes that each file contains MCONV attributes and entities like datestamps, and processes it accordingly. Note that only regular (seekable) files may be viewed; files compressed with gzip(1) will be decompressed to a temporary file automatically. For more details of the key presses within the viewer, see the FILE VIEWER and MENU VIEWER sections below.

OPTIONS
The first few options determine the way data is displayed.

-m, --menu
    Each FILE specified is to be shown as a menu, not as a normal file. mview -m is to mview as mconv -m is to mconv -f. See the MENU VIEWER section for controls.

-L, --listed
    Each FILE specified is to be shown as a listed directory (a menu generated from the contents of the given directory).

-l N, --line=N, +N
    Start the viewer with line N at the bottom of the screen. Note that -l and --line apply to all files specified on the command line, but +N only applies to those files specified after it.

-z, --bottom
    Start at the bottom of each file.

-T, --top
    Start at the top of each file. This is the default.

-c, --no-colours, --monochrome
    Do not output any colour attributes; view everything in black and white.

The following options control the use of a database recording the files read and the last line number the viewer saw them at.

-d FILE, --ldb=FILE
    Use FILE as a last-access database containing records of which files have been looked at in the past. If FILE does not exist, it will be created. Note that old records are never purged automatically; see the -p option for that. This option overrides the MVIEW_LDB environment variable.

-n, --no-ldb
    Don't use a last-access database, even if one is specified in the MVIEW_LDB environment variable.

-p, --purge-ldb
    Purge the last access database specified by -d or MVIEW_LDB by removing from it any records pertaining to files that can no longer be found, and then exit without viewing any files.

-f FILE, --file FILE
    Pretend, for last access database purposes, that FILE was the file accessed instead of using the real filename.

The next few options determine which restrictions are to be put in effect.

-y, --anonymous
    Account names are stripped from From: lines, leaving only the namelines.

-r, --readonly
    The files cannot be modified.

-e, --no-edit
    Direct-editing is disallowed, though files can still be added to.

The last two options give information about the program.

--help
    Print a usage message on standard output and exit successfully.

-V, --version
    Print version information on standard output and exit successfully.

FILE VIEWER
This viewer offers many of the facilities that the BBS file reader has. In particular, string searching, file editing, and indexing can be done; it is also useful to know that the file is rescanned every five seconds, so if you are viewing a log file, for instance, your view will change as the file grows. Optionally, you may record your position in files in a last-access database (LDB). This acts as a sort of "bookmark" and means that next time you look at a file you viewed before, you will start at the same place you left off. To do this, either use the -d option (see OPTIONS, above) or set the MVIEW_LDB environment variable to point to the file you wish to store your LDB in. In the file viewer, the following keys may be pressed:

[^L]
    Redraw the screen, also forcing a rescan of the file.

[Q] Exit the viewer immediately and move to the next file (or return to the command line if there are no more files to view).

[SPACE], [+], [RIGHT ARROW], [PAGE DOWN]
    Scroll down one screenful.

[C] Scroll down one screenful, unless you are already at the bottom of the file, in which case the viewer exits as if you had pressed [Q].

[B], [-], [LEFT ARROW], [PAGE UP]
    Scroll up one screenful.

[UP ARROW]
    Scroll up one line.

[DOWN ARROW]
    Scroll down one line.

[RETURN]
    Scroll down one line, unless you are already at the bottom of the file, in which case the viewer exits as if you had pressed [Q].

[0], [^A], [HOME]
    Move to the top of the file.

[Z], [$], [^E], [END]
    Move to the bottom of the file.

[[] Move so that the last datestamp is at the top of the screen (i.e. move to the previous edit).

[]] Move so that the next datestamp is at the top of the screen (i.e. move to the next edit).

[.] Edit the file with the editor specified by the EDITOR or VISUAL environment variables. If none is specified, the default of /usr/bin/joe is used. On exiting the editor, the file is rescanned.

[A] Add an edit with the current datestamp and From: line derived from the current user's details prepended. The editor is called as with [.], and on exiting the editor, the file is rescanned and the viewer placed at the bottom of the new edit. Note that if the environment variable MVIEW_DIR is set, the intermediate file $MVIEW_DIR/edit is used instead of a temporary file. The environment variables MVIEW_USER and MVIEW_NAMELINE can be used to override the default username and nameline - see the ENVIRONMENT section below.

[K] Copy a chunk of the current file to the temporary file used when [A]dding (see above). When a file is next [A]dded to, the intermediate file will already contain the saved file chunk instead of the usual Subject: heading. The MVIEW_DIR environment variable must be set for this to work.

[G] Go to a specific line or percentage.

[/] Search forwards for a string. Matching is case insensitive.

[\] Search backwards for a string. Matching is again case insensitive.

[I] View an index of the file.

[M] Mail the current file to yourself.

[?] View an online summary of the key presses available.

MENU VIEWER
The menu viewer, mview -m, shows the menu items present in the menu file and allows the user to select options from it. In addition to those keys present in the menu, the following keys have meaning:

[^L]
    Redraw the screen, also forcing a rescan of the menu.

[Q] Return to the previous menu from a submenu, or exit the viewer and move to the next file if the current menu is the first one.

[RETURN]
    Return to the previous menu from a submenu, or do nothing if the current menu is at the top level (like [Q], but never quit).

[SPACE]
    Start a scan. If any file in the current menu has not been read up to date, it will be opened in the file viewer (see FILE VIEWER, above). Otherwise, the first submenu containing an unread file will be opened. If there are no files left to read, the scan stops.

[+] Move down one screenful of options (for menus with more options than will fit on the screen).

[-] Move up one screenful of options.

[=] Set subscription options for a file or for all items in the menu. Subscriptions may be set so an item is not skipped on a scan (i.e. scanned into as usual), or skipped altogether.

[.] Edit the current menu. If the current menu is a listed directory rather than a real menu file, options will be given to add, rename or delete files in that directory. If the current menu has a title, the option will be given to edit that title.

[BACKSPACE]
    Mark all files in the current menu as having been read "up to date".

[^X]
    Enter the default shell with the current working directory set to the directory containing the current menu.

[?] View an online summary of the key presses available.

NOTES
When running mview under screen(1), attributes can be missed off if they start at the beginning of a line. At first I thought this was a bug in mview, but I could not reproduce it on a bare Linux terminal, so it could be a bug in screen. At any rate it's not very noticeable.

ENVIRONMENT
The following environment variables are important to mview:

TERM
    The type of terminal on which mview is being run. Has no importance unless you are using the file viewer with termcap(3) support compiled in.

COLUMNS
    Sets the number of columns on the screen. Used by the file viewer if termcap(3) support is not compiled in or if no termcap entry for terminal type TERM can be found.

LINES
    Sets the number of lines on the screen, used as COLUMNS.

EDITOR, VISUAL
    The full path of the editor to use when [.] is pressed in the file viewer (see FILE VIEWER above). If both are set, EDITOR takes precedence. If neither are set, the default of /usr/bin/joe is used.

MVIEW_USER
    The username to say edits being added with [A] are from. If unset, the current username is used.

MVIEW_NAMELINE
    The nameline of edits being added with [A]. If unset, the gecos field of the current user is used (i.e. their real name as reported by finger(1)).

MVIEW_LDB
    The file to use as a last-access database. An LDB consists of a text file containing one record per line; each record contains the file name followed by an encoded string representing the position of the last line the viewer saw it at. Thus you may manually remove entries from your LDB if it gets too large, or you can use `mview -p' to purge entries relating to files that have since been deleted.

MVIEW_DIR
    Directory in which to place the intermediate file `edit', which is used for writing new entries with [A]dd. If not set, MVIEW_EDIT_TMP or a temporary file will be used instead.

MVIEW_EDIT_TMP
    File to use as a temporary editor file if MVIEW_DIR is not set. If this is not set, a temporary file will be used.

MANIM_PROG
    Program to use instead of qmanim to run Anim programs. Note that whatever program you specify must accept the -n and -e options (account name and nameline).

BUGS
There may be a memory leak in the file viewer. This is not known for sure. Compressed files should be made read-only, because they are not locked properly when modifications are being made and thus data could be lost if more than one user with edit permissions tries to access the file at once.

AUTHOR
Andrew Wood <mconv@ivarch.com>
mconv: http://mconv.sourceforge.net/

SEE ALSO
mconv(1), mbbs(1), mgid(1), mtrunc(1), mtime(1), mte(1), gzip(1), finger(1), termcap(3), passwd(5)