head	1.15;
access;
symbols
	groff-1_19_2:1.12
	FDL:1.2
	groff-1_19_1:1.1;
locks; strict;
comment	@# @;


1.15
date	2006.10.14.05.59.54;	author wl;	state dead;
branches;
next	1.14;

1.14
date	2006.07.28.16.36.02;	author bwarken;	state Exp;
branches;
next	1.13;

1.13
date	2005.09.14.01.11.28;	author bwarken;	state Exp;
branches;
next	1.12;

1.12
date	2005.08.23.09.57.09;	author wl;	state Exp;
branches;
next	1.11;

1.11
date	2005.08.03.06.32.11;	author wl;	state Exp;
branches;
next	1.10;

1.10
date	2005.07.31.07.53.15;	author wl;	state Exp;
branches;
next	1.9;

1.9
date	2005.07.07.20.03.13;	author wl;	state Exp;
branches;
next	1.8;

1.8
date	2005.07.02.17.37.54;	author wl;	state Exp;
branches;
next	1.7;

1.7
date	2005.06.24.19.52.39;	author wl;	state Exp;
branches;
next	1.6;

1.6
date	2005.06.20.19.27.41;	author wl;	state Exp;
branches;
next	1.5;

1.5
date	2005.05.26.21.01.57;	author wl;	state Exp;
branches;
next	1.4;

1.4
date	2005.05.20.06.12.24;	author wl;	state Exp;
branches;
next	1.3;

1.3
date	2004.11.16.09.18.41;	author wl;	state Exp;
branches;
next	1.2;

1.2
date	2004.06.04.22.42.34;	author wlemb;	state Exp;
branches;
next	1.1;

1.1
date	2004.05.04.04.46.54;	author wlemb;	state Exp;
branches;
next	;


desc
@@


1.15
log
@

* release of groffer 1.0.0

Changements of the shell version since 0.9.31

* shell/groffer.sh: Use version.sh in the upper directory.


The groffer versions 1.* have two kinds of program, a shell
version and a Perl version.

The shell version is kept from the old shell only versions of
groffer 0.*.  Most of the former files in the main groffer
directory are now moved to the subdirectoy shell/.

The Perl version of groffer is a complete rewrite; most of its
files are found in the subdirectory perl/.

The Makefile.sub decides whether the shell or Perl version of
groffer is installed.  This is done by the program perl_test.pl.

In the following, all files in the groffer directory tree are
mentioned.

* ChangeLog: This file.  It contains information for groffer
versions >= 1.0.0 with shell and Perl kinds.  For older groffer
versions, see shell/ChangeLog.0 which contains information for the
shell only versions of groffer 0.*.

* Makefile.sub: The old Makefile.sub was extended to support the
shell and the Perl version of groffer at the same time.  If the
test of perl_test.pl succeeds the groffer Perl version will be
installed, otherwise the shell version is used.

* perl_test.pl: This is used by Makefile.sub and installed with
the Perl version of groffer.  It is a test of the installed perl
version.  The installed Perl version should be greater or equal
than the version that is required by this file.

* version.sh: This is the old file kept from the shell version of
groffer.  It stores the groffer version, the date of the last
update, and the groff version.  It is used and installed for the
shell and Perl version of groffer.

* README: This is the old README file extended by information on
the shell and Perl kinds of groffer.

* perl/: Subdirectory for the Perl version of groffer.

* perl/groffer.pl: This is the groffer script of the Perl
version, a Perl source file that handles the complete groffer
functionality.

* perl/man.pl: This is the collection of functions that are
related to man pages, apropos, and whatis.  It is loaded by
perl/groffer.pl.

* perl/func.pl: This is the collection of miscellaneous functions.
It is loaded by perl/groffer.pl.

* perl/split_env.sh: A shell script that is used by
perl/groffer.pl to split a large shell environment variable to a
Perl array.

* perl/groffer.man: This is the man page of the Perl version of
groffer.  It is derived from groffer.man of the shell version.  It
will only be installed when the Makefile.sub chooses to install
the Perl version of groffer instead of the shell version.

* perl/README_PERL: This file contains information of the Perl
compatibility and details that are special to the Perl version.

* shell/: Subdirectory for the shell version of groffer.

* shell/ChangeLog.0: The former ChangeLog file of the groffer
versions 0.* was moved to this file.  It contains information of
the shell only version of groffer 0.*.

* shell/groffer.sh: This is the old groffer.sh file of the shell
version.

* shell/groffer2.sh: This is the old groffer2.sh file of the shell
version.

* shell/groffer.man: This is the old man page groffer.man of the
shell version.  The shell version keeps its own man page.  It will
only be installed when the Makefile.sub chooses to install the
shell version instead of the Perl version.

* shell/README_SH: This is the old README_SH file of the shell
version containing information of the shell compatibility.
@
text
@Additional description for the shell version of `groffer'


Scripts

The shell version of `groffer' contains two files, `groffer.sh' and
`groffer2.sh'.

`groffer.sh' is a short introductory script without any functions.  I
can be run with a very poor Bourne shell.  It just contains some basic
variables, the reading of the configuration files, and the
determination of the shell for `groffer2.sh'.  This script is
transformed by `make' into `groffer' which will be installed into
@@bindir@@, which is usually /usr/local/bin.

`groffer2.sh' is a long main script with all functions; it is called
by `groffer.sh' (`groffer' after installation).  It is installed
unchanged into @@libdir@@/groff/groffer, which is usually
/usr/local/lib/groff/groffer.  This script can be called with a
different shell, using the `groffer' option `--shell'.


Options

The `groffer' script provides its own option parser.  It is compatible
to the usual GNU style command line This includes long option names
with two signs such as `--option', clusters of short options, the
mixing of options and non-option file names, the option `--' to close
the option handling, and it is possible to abbreviate the long option
names.  The abbreviation of long options is enhanced by letting each
internal `-' sign generate a new center of abbreviation.  So each
command line argument starting with `--' can represent a multiple set
of abbreviations.

The flexible mixing of options and file names in GNU style is always
possible, even if the environment variable `$POSIXLY_CORRECT' is set
to a non-empty value.  This disables the rather wicked POSIX behavior
to terminate option parsing when the first non-option command line
argument is found.


Error Handling

Error handling and exit behavior is complicated by the fact that
`exit' can only escape from the current shell; trouble occurs in
subshells.  This was solved by adding a temporary error file that is
tested by function exit_test() and by replacing `var=$(...)' by
function obj_from_output().


Function Definitions in `groffer2.sh'

Each funtion in groffer2.sh has a description that starts with the
function name and symbols for its arguments in paranthesis `()'.  Each
`<>' construction gives an argument name that just gives a hint on
what the argument is meant to be; these argument names are otherwise
irrelevant.  The `>' sign can be followed by another character that
shows how many of these arguments are possible.

<arg>      exactly 1 of this argument
<arg>?     0 or 1 of these arguments
<arg>*     arbitrarily many such arguments, incl. none
<arg>+     one or more such arguments
<arg>...   one or more such arguments
[...]      optional arguments

A function that starts with an underscore `_' is an internal function
for some other function.  The internal functions are defined just
after their corresponding function.


External Environment Variables

The groffer.sh script uses the following external system variables.
It is supposed that these variables are already exported outside of
groffer.sh; otherwise they do not have a value within the script.

external system environment variables that are explicitly used
$DISPLAY:		Presets the X display.
$LANG:			For language specific man pages.
$LC_ALL:		For language specific man pages.
$LC_MESSAGES:		For language specific man pages.
$PAGER:			Paging program for tty mode.
$PATH:			Path for the programs called (`:' separated list).

groffer native environment variables
$GROFFER_OPT		preset options for groffer.

all groff environment variables are used, see groff(1)
$GROFF_BIN_PATH:	Path for all groff programs.
$GROFF_COMMAND_PREFIX:	'' (normally) or 'g' (several troffs).
$GROFF_FONT_PATH:	Path to non-default groff fonts.
$GROFF_TMAC_PATH:	Path to non-default groff macro files.
$GROFF_TMPDIR:		Directory for groff temporary files.
$GROFF_TYPESETTER:	Preset default device.

all GNU man environment variables are used, see man(1).
$MANOPT:		Preset options for man pages.
$MANPATH:		Search path for man pages (: list).
$MANROFFSEQ:		Ignored because of grog guessing.
$MANSECT:		Search man pages only in sections (:).
$SYSTEM:		Man pages for different OS's (, list).


Object-oriented Functions

The groffer script provides an object-oriented construction (OOP).  In
object-oriented terminology, a type of object is called a `class'; a
function that handles objects from a class is named `method'.

In the groffer script, the object is a variable name whose content is
the object's data.  Methods are functions that have an object as first
argument.

The basic functions for object handling are obj_*().

The class `list' represents an array structure, see list_*().


Speed

The major speed gain is the disabling of all debug features.  This is
the default for the installed version of `groffer'.  Before the run of
`make', the debug feature of $_DEBUG_FUNC_CHECK, corresponding to
option --debug-func, is enabled by default.  The resulting heavy
slowing down should be regarded as a temporary feature.

Another increase of speed was the replacement of the many `ls' calls
by analysing a `find' of manpath with `grep'.


Shell Compatibility

The `groffer' shell scripts are compatible to both the GNU and the
POSIX shell and utilities.  Care was taken to restrict the programming
technics used here in order to achieve POSIX compatibility as far back
as POSIX P1003.2 Draft 11.2 of September 1991.  This draft is
available at http://www.funet.fi/pub/doc/posix/p1003.2/d11.2 in the
internet.

The POSIX draft does not include `local' variables for functions.  So
this concept was replaced by global variables with a prefix that
differs for each function.  The prefix is chosen from the function
name.  These quasi-local variables are unset before each return of the
function.

The `groffer' scripts were tested under the shells `ash', `bash',
`bash-minimal', `dash', 'ksh', `mksh', `pdksh', 'posh', and `zsh'
without problems in Linux Debian.  A shell can be tested by the
`groffer' option `--shell', but that will run only with groffer2.sh.
To start it directly from the beginning under this shell the following
command can be used.

  <shell-name> groffer.sh --shell=<shell-name> <argument>...


Some shells are not fully POSIX compatible.  For them the following
restrictions were done.  For more information look at the
documentation `Portable shells' in the `info' page of `autoconf'
(look-up in Emacs-Help-Manuals_Info).

- The command parts `then', `else', and `do' must be written each on a
  line of their own.

- Replace `for i in "$@@"' by `for i' and remove internal `;' (kah).

- Replace `set -- ...' by `set x ...; shift'.  After the first
  non-option argument, all arguments including those starting with `-'
  are accepted as non-option.  For variables or `$()' constructs with
  line-breaks, use `eval set' without quotes.  That transforms a
  line-break within a variable to a space.

- The name of the variable in `for' is chosen as a single character
  (old ash).  The content of such variables is not safe because it can
  also occur in other functions.  So it is often stored in an
  additional quasi-local variable.

- `echo' is not portable on options; some `echo' commands have many
  options, others have none.  So `echo -n' cannot be used, such that
  the output of each function has complete lines.  There are two
  methods to avoid having `-' as the first character of any argument.
  Either a character such as `x' can be prepended to the argument;
  this must later on be removed by `sed'.  Otherwise, `echo' can be
  replaced by `cat <<EOF'.

- `ls' has problems.  Old UNIX systems echoed the error message to
  standard output.  So handle the output with `sed'.  If the output
  contains `not found' map it to an empty string.

- As `test -e' is not available in Solaris 2.5 replace it by
  `test -f || test -d'.

- As `unset' is not supported by all shells replace it by `eval
  ${_UNSET}' where this variable is `unset' if it exists and `:'
  otherwise.

- Some shells have problems with options in `eval'.  So quoting must
  be done right to hide the options from `eval'.

- In backquote calls `` avoid the backquote ` in comments.

- Replace `true' by `:', `false' isn't used.

- Do not redefine builtins as functions (ash).

- Avoid `[^...]' in `case' patterns (ash).

- `trap' does not allow error code 127.

The scripts call the following commands with all options used:
.
:
apropos
break
bzip2 -c -d -t
cat
catz
cd
continue
echo
eval
expr
grep
groff -v
grog -T -X -Z
gs -c -d -f -q -s
gzip -c -d -f
less -r -R
ls
man -k --apropos
mkdir
mv
pwd
return
rm -f -r
rmdir
sed -e -n
set -e
sh -c
shift
test -c -d -f -r -s -w -x
trap
umask
unset


Bugs

If the `groffer' run is interrupted by Crtl-C the clean up is not done
by all shells.  The `trap' commands work for the shells `bash',
`bash-minimal', and 'ksh'; they do not work for `ash', `dash',
`pdksh', `posh', and `zsh'.


####### License

Last update: 28 Jul 2006

Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
Written by Bernd Warken

This file is part of `groffer', which is part of `groff'.

`groff' is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

`groff' is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
License for more details.

You should have received a copy of the GNU General Public License
along with `groff'; see the files COPYING and LICENSE in the top
directory of the `groff' source.  If not, write to the Free Software
Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.


####### Emacs settings

Local Variables:
mode: text
End:
@


1.14
log
@groffer update 0.9.24.
@
text
@@


1.13
log
@
Update groffer 0.9.23
@
text
@d30 4
a33 1
names.
d257 1
a257 1
Last update: 07 Sep 2005
d259 1
a259 1
Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
@


1.12
log
@

	* release of groffer 0.9.22

	### `--whatis'

	Produce a `groff' output and allow wild cards on filespec
	parameters for `--whatis'.

	* groffer2.sh:
	- $_FILESPEC_ARG: New variable for storing the actual filespec
	parameter.
	- main_do_fileargs(): Set $_FILESPEC_ARG and add
	what_is_filespec().
        - main_parse_args(): Add --all to --whatis.
	- to_tmp_line(): New function to write the arguments to the
	temorary cat file.
	- whatis_filename(): Rename of what_is().  Construct a better
	printout using $_FILESPEC_ARG.  Repair the sed sequneces.
	- whatis_filespec(): New function to print the filespec once
	during the `whatis' process.
	- whatis_header(): New funtion for printing the header of the
	`whatis' output.

	* groffer.man: Revise the documentation of --whatis.

	### `--apropos*'

	Produce `groff' for `--apropos*'.  Allow `--sections' for
	`--apropos', ignore it  with `--apropos-*'.

	* groffer2.sh:
	- --apropos*: Make these options without argument.
	- $_APROPOS_PROG: New variable for the program that is is used for
	`apropos'.
	- $_APROPOS_SECTIONS: New variable to determine the sections that
	are filtered out of `apropos' output depending on `--apropos-*'.
	- apropos_filespec(): Handling of apropos at the filespec level.
	- apropos_run(): Remove it.
	- apropos_setup(): New function.
	- main_set_mode(): Remove handling of $_OPT_APROPOS*.

	* groffer.man:
	- Revise the documentation of `--apropos*'.
	- Split section 'options for GNU man' into two sections `options
	for man pages' and `long options taken over from GNU man'.
	- Move `--apropos*', `--whatis', `--man', and `--no-man' to
	section `options for man pages'.

	### special display (apropos and whatis)

	* groffer2.sh:
	- special_setup(): New function that chooses the setup between
	apropos and whatis.
	- special_filespec(): New function that does the output at the
	filespec level for apropos or whatis.

	### handle `--sections' for man page searching

	* groffer2.sh:
	- man_do_filespec(): Use $_OPT_SECTIONS of --sections instead of
	$_MAN_AUTO_SEC if non-empty.  If a section was given on the
	filespec parameter $_OPT_SECTIONS is ignored.  This differs from
	`man' which always uses the restricted sections of --sections.
	This function works for both normal man page search and whatis.
	- apropos_filespec(): Use --sections for --apropos, but not for
	--apropos-* because these provide already their own sections.

	### wildcards in filespec arguments

	* groffer2.sh: Wildcards are now accepted.  In `--apropos*' and
	`--whatis' they are interpreted as wildcard search elements; but
	in normal display they are only handled as their own character.

	### development; new option

	* groffer2.sh:
	- --print: New option that prints just its argument for parameter
	check.
	- usage(): Add new option.
	- $_OPT_DO_NOTHING: New variable for do_nothing().  Handle it at
	the end of main_parse_Args().

	* groffer.man: Add information on --print.

	### safe exit

	* groffer2.sh:
	- error(): Always exit with $_ERROR.
	- exit_test(): New function to exit when first exit was hidden by
	().  Call it after each $().

	### automatic shell determination

	* groffer.sh:
	- If no option --shell is given perform a test of several shells
	to automatically start some shell for groffer2.sh.  `ksh' is used
	first because it can be safely terminated by Ctrl-C.
	- This can be cancelled by providing --shell=''.
	- Add test on `sed' program.

	* groffer.man: Revise information on --shell.

	### trap

	* groffer2.sh:
	- trap_set(): Remove argument.  Instead of $_ALL_EXIT use only
	signal 0.
	- trap_unset(): Rename trap_clean().  Instead of $_ALL_EXIT use
	only signal 0.
	- $_ALL_EXIT: Remove this variable.
	- Replace all direct `trap' calls by trap_set().

	* README_SH: New section `Bugs' on `trap'..

	### user errors, error output without function stack

	* groffer2.sh:
	- error_user(): New function for user errors.
	- error(): Remove call of clean_up() because the trap will do it
	with the exit.  Remove the `kill' commands.  Create a temporary
	file `.error' that can be tested by exit_test() for a better exit
	test (especially for shell `ksh').
	- $_DEBUG_USER_WITH_STACK: New variable to enable function stack
	output in error_user().
	- list_from_cmdline(), list_single_from_abbrev(), main_set_mode():
	Use error_user().

	### test modes on X and tty

	* groffer2,sh:
	- is_X(), is_not_X(): New functions for checking on X Window.
	- $_VIEWER_HTML_TTY, $_VIEWER_HTML_X: New variables that split
	$_VIEWER_HTML.  Add `galeon'.
	- main_parse_args(): Allow mode change for graphical modes only
	when in X Window.
	- _do_display() of main_display(): Create a special run for
	viewers that run on the terminal; `lynx' is the only one so far.

	### add $GROFFER_MODE to command line

	* groffer.sh:
	- After the handling of the configuration files integrate
	$GROFFER_OPT to the command line.
	- This makes a `set' in the shell determination unnecessary.

	* groffer2.sh:
	- The debug test gets simpler because quotes are vanished without
	$GROFFER_OPT.
	- main_parse_MANOPT(): Prepend $mpm_list to the command line.
	- main_parse_args(): `set' is unnecessary.

	### debug; new options

	* groffer2.sh:
	- --debug-all, --debug-lm, --debug-params, --debug-shell,
	--debug-stacks, --debug-tmpdir, --debug-user: New options.
	- --debug: Enable all debug variables except $_DEBUG_STACKS and
	$_DEBUG_LM.  By the new options the smallest abbreviation is now
	`--debug'.
	- $_DEBUG_STACKS: Rename $_DEBUG.
	- $_DEBUG_PRINT_TMPDIR: New debug variable for printing the name
	of the temporary directory in main_init().
	- $_OPT_DEBUG: Remove this variable because debug is handled at
	the early part of the script.
	- clean_up(): Enlarge $_DEBUG_KEEP_FILES to not deleting the
	temporary directory.
	- usage(): Move all development options on a section of its own.
	- Move the test of rudimentary shell functionality at the
	beginning of the script.  Add test on `sed'.
	- Follow this by the debug section.  The determination of all
	--debug* options can be done without a function.

	* groffer.man: Revise information on --debug and add new options.

	### variables

	* groffer.sh:
	- $_ERROR: Move the definition of this variable here.
	- $_GROFF_VERSION: New variable, is set over @@...@@ construct.
	- $_OUTPUT_FILE_NAME: Move this variable to groffer2.sh.

	* groffer2.sh:
	- $_MAN_AUTO_SEC_LIST: Rename $_MAN_AUTO_SEC because it represents
	a list.
	- $_MAN_AUTO_SEC_CHARS: New read-only variable for storing
	$_MAN_AUTO_SEC_LIST in [] construct.  Use it in man_do_filespec()
	and whatis_filename().
	- $_SPACE_CASE: New read-only variable with [] on space characters
	with \ for `case' patterns.  Use it in several functions.
	- $_SPACE_SED: New read-only variable with [] on space characters
	for `sed'.  Use it in several functions.

	### options and display

	* groffer2.sh:
	- list_from_cmdline(): Add test whether the same abbreviation is
	part of long options with and without arguments.  Give handling of
	`=' a `case' pattern of its own.
	- main_display(): Remove unnecessary calls of `clean_up' in order
	to use `mozilla' without problems.  In _do_display(): Fix -X by
	providing a different process when $_DISPLAY_PROG is empty.
	- main_set_mode(): Accept options for viewers as is, without check
	for program.  Add test whether no program is given for a mode.
	This avoids unnecessary empty $_DISPLAY_PROG in main_display().

	### viewer programs that run on the terminal (tty); new options

	* groffer2.sh:
	- $_VIEWER_TERMINAL: New variable that stores whether a viewer was
	supposed to run on tty.
	- --dvi-viewer-tty, --html-viewer-tty, --pdf-viewer-tty,
	--ps-viewer-tty, --tty-viewer-tty, --X-viewer-tty, --x-viewer-tty,
	--www-viewer-tty: New options for viewers that run on a terminal.
	- main_parse_args(), _do_display() of main_display(): Use the new
	options and the new variable.
	- usage(): Add the new options.

	* groffer.man: Add information on options --*-viewer-tty.

	### other fixes

	* groffer2.sh:
	- _do_display() of main_display(): Bear errors of `groff' run.
	- is_not_file: Fix to have exactly one argument.
	- is_not_prog(): Handle no arguments.
	- list_has_not(): Fix.
	- main_do_fileargs(): Remove $mdfa_exitcode.
	- register_title(): Limit title to 4 elements.
	- version(): Print the version information to standard output just
	like `groff' does.
	- --no-special: New option to disable former calls of `--all',
	`--apropos*', and `whatis.
	- --title: Make it an option with argument.
@
text
@d43 3
a45 2
subshells.  This was solved by sending kill signals, see $_PROCESS_ID
and error().
d117 12
d254 1
a254 1
Last update: 19 August 2005
@


1.11
log
@

* release of groffer 0.9.21

### @@...@@ constructs

* groffer.sh:
- $_AT: New variable for `@@'.
- @@...@@: Replace the @@...@@ constructs by variables _AT_..._AT.
These constructs are transformed by `make' to useful information.
Keep all of these constructs in the first part of groffer.sh.  For
a run before a `make' call, the script sets these variables to
special values for testing purpose.
- $_GROFFER_LIBDIR: Variable pointing to the groffer library
directory @@libdir@@/groff/groffer.

### Configuration files

* groffer.sh:
- Add test for `$()' construct.
- Read and transform the configuration files and execute the
emerging commands.  The `sed' script was heavily enlarged to
handle line with spaces and quotes.  The emerging script is now
called by `eval', so no temporary file is needed.
- $_CONF_FILE_ETC, $_CONF_FILE_HOME: New variables for the config
files.
- $_SQ, $_SP: Move variables for characters before the handling of
the configuration files.  Rename $_SQUOTE to $_SQ and $_SPACE to
$_SP.
- $GROFFER_OPT: Remove cleaning of this variable before the
reading of the configuration files.

* groffer2.sh:
- main_init(): Remove the getting of the configuration files.

### Rewrite the shell determination

* groffer.sh:
- Get rid of all functions in `groffer.sh'.  Rewrite the shell
determination with `` and $().
- --shell: Shortest abbreviation is `--sh'.  Allow arguments for
the shell name.
- Allow an empty argument for --shell as shell name to overwrite a
specified shell; an empty shell name gets back to the default
shell.
- The shell determination now inludes the full handling of the
config files.  The `--shell' option needs no longer a line
starting with `-'.

### Test of unset

* groffer.sh:
- Remove test of `unset'.
- Remove all calls of `unset'.
- Use one character names for all variables that are meant to be
local in this script.

* groffer2.sh:
- Move the test of `unset' to the testing of rudimentary shell
functionality without change.

        ### Allow abbreviations for long options

* groffer2.sh:
- list_has_abbrev(): New function for checking a list having an
element with a given abbreviation.
- list_get_single_from_abbrev(): New function to retrieve the
element having a given abbreviation.
- list_from_cmd_line(): For an option abbreviation determine the
corresponding long option.
- From the man option lists remove the elements that are also in
a groffer list.
- Allow abbreviation for the early test of --debug.

* groffer.sh: Allow abbreviation for the early test on --shell.
- get_opt_shell(): Rewrite _get_opt_shell() and the shell test
around it.
- test_on_shell(): Rename function _test_on_shell().
- $_SHELL: global variable for the shell to run groffer2.sh.

### Get rid of `sh -c'

* groffer2.sh:
- main_display(), _do_display(): Remove the `sh -c' calls.  Make
the cleanup working without it.
- _do_display(): Extend _do_display() such thatit can be used for
the pdf mode as well.
- _make_pdf(): New subfunction of main_display() for running the
additional parts of pdf mode in _do_display().
- rm_file(), rm_file_with_debug(), rm_tree(): New functions for
removing files and directories.

### Change directory

* groffer2.sh:
- $_START_DIR: New variable to store the directory at the starting
time of the script.
- main_display(): Go to the groffer temporary directory to be able
to process internal `groff' data like pictures.
- clean_up(): Get back to the starting directory.

### Compatibility with strange shells

* groffer2.sh:
- clean_up(): `zsh' and `posh' had difficulties with `eval'.
- is_*(): Add test on empty argument.  Some shells return true on
`test -d' etc. with empty argument, while most shells return
false.
- echo1(); New function to print single line `cat <<EOF'.  Replace
all `echo x' by `echo1'.
- list_has_abbrev(), list_from_cmdline(): Correction.
- main_parse_MANOPT(): Repair and revise.
- --do-nothing: New option without output (for development).
- Rewrite rudimentary shell functionality near the beginning of
the script.

* groffer.sh, groffer2.sh:
- Remove `;' after the commands `if', `while', and `until'.

### Debugging information

* groffer2.sh:
- $_DEBUG_PRINT_PARAMS: New variable for printing all parameters
from the config files, $GROFFER_OPT, and command line after they
have been transformed.
- $_DEBUG_PRINT_SHELL: New variable for printing the name of the
shell found in groff.sh.
- main(): Move the landmarks of main-*() into main().

### Further checks and additions

* groffer.sh, groffer2.sh:
- $_PROGRAM_NAME: Replace this variable by `groffer'.  The program
name is now stable.
- $_GROFFER_RUN: Remove this variable.  As `groffer.sh' or
`groffer' is no longer rerun, this variable is not necessary any
more.

* groffer2.sh:
- main_set_resources(): Make the default viewers capable to use
arguments in the list.
- leave(): Add an argument for given exit code.  Use it where
suitable in main_*().
- do_filearg(): Add error messages for non-existing files and man
pages.
- _do_opt_V(): New subfunction of main_display() to handle the
output for option `-V'.  `groff -V' is greatly enlarged by
`groffer' specific information.
- register_title(): Handle file names with spaces.  Replace spaces
by `_'.
- is_existing(): Add `test -c' for special files.
- usage(): Add `=arg' to the options with an argument.  Add option
`--tty-viewer'.
- kghostview: In the default viewer list, add option
`--scale=1.45'.
- $_OPTS_CMDLINE_SHORT_NA: Correct a lacking space.

* Makefile.sub: Repair the installation instructions for
groffer2.sh.

* groffer.man:
- Add paragraph on option handling.
- Add option `--do-nothing'.
- Reorder option for development and `groff'.
- Rewrite documentation for option `-V'.
- Expand `--shell'.
- Reformulate sections CONFIGURATION FILES, COMPATIBILITY and SEE
ALSO.
- Make `man' italic where possible.
- .copyleft: Adjust the fonts.

* README: Update sections `Output' and `Compatibility'.

* README_SH:
- Add `mksh' as compatible shell.
- Add information on the scripts after the split.

* TODO: Remove some fulfilled parts.

* ChangeLog: Remove final spaces.
@
text
@d23 93
d132 5
a136 5
`dash', 'ksh', `mksh', `pdksh', 'posh', and `zsh' without problems in
Linux Debian.  A shell can be tested by the `groffer' option
`--shell', but that will run only with groffer2.sh.  To start it
directly from the beginning under this shell the following command can
be used.
d231 1
a231 32
Options

The `groffer' script provides its own option parser.  It is compatible
to the usual GNU style command line This includes long option names
with two signs such as `--option', clusters of short options, the
mixing of options and non-option file names, the option `--' to close
the option handling, and it is possible to abbreviate the long option
names.

The flexible mixing of options and file names in GNU style is always
possible, even if the environment variable `$POSIXLY_CORRECT' is set
to a non-empty value.  This disables the rather wicked POSIX behavior
to terminate option parsing when the first non-option command line
argument is found.


Error Handling

Error handling and exit behavior is complicated by the fact that
`exit' can only escape from the current shell; trouble occurs in
subshells.  This was solved by sending kill signals, see $_PROCESS_ID
and error().


Function Definitions in `groffer2.sh'

Each funtion in groffer2.sh has a description that starts with the
function name and symbols for its arguments in paranthesis `()'.  Each
`<>' construction gives an argument name that just gives a hint on
what the argument is meant to be; these argument names are otherwise
irrelevant.  The `>' sign can be followed by another character that
shows how many of these arguments are possible.
d233 4
a236 58
<arg>      exactly 1 of this argument
<arg>?     0 or 1 of these arguments
<arg>*     arbitrarily many such arguments, incl. none
<arg>+     one or more such arguments
<arg>...   one or more such arguments
[...]      optional arguments

A function that starts with an underscore `_' is an internal function
for some other function.  The internal functions are defined just
after their corresponding function.


External Environment Variables

The groffer.sh script uses the following external system variables.
It is supposed that these variables are already exported outside of
groffer.sh; otherwise they do not have a value within the script.

external system environment variables that are explicitly used
$DISPLAY:		Presets the X display.
$LANG:			For language specific man pages.
$LC_ALL:		For language specific man pages.
$LC_MESSAGES:		For language specific man pages.
$PAGER:			Paging program for tty mode.
$PATH:			Path for the programs called (`:' separated list).

groffer native environment variables
$GROFFER_OPT		preset options for groffer.

all groff environment variables are used, see groff(1)
$GROFF_BIN_PATH:	Path for all groff programs.
$GROFF_COMMAND_PREFIX:	'' (normally) or 'g' (several troffs).
$GROFF_FONT_PATH:	Path to non-default groff fonts.
$GROFF_TMAC_PATH:	Path to non-default groff macro files.
$GROFF_TMPDIR:		Directory for groff temporary files.
$GROFF_TYPESETTER:	Preset default device.

all GNU man environment variables are used, see man(1).
$MANOPT:		Preset options for man pages.
$MANPATH:		Search path for man pages (: list).
$MANROFFSEQ:		Ignored because of grog guessing.
$MANSECT:		Search man pages only in sections (:).
$SYSTEM:		Man pages for different OS's (, list).


Object-oriented Functions

The groffer script provides an object-oriented construction (OOP).  In
object-oriented terminology, a type of object is called a `class'; a
function that handles objects from a class is named `method'.

In the groffer script, the object is a variable name whose content is
the object's data.  Methods are functions that have an object as first
argument.

The basic functions for object handling are obj_*().

The class `list' represents an array structure, see list_*().
d241 1
a241 1
Last update: 2 August 2005
@


1.10
log
@

________________________________________________________________
* release of groffer 0.9.20

### Split groffer.sh into two files groffer.sh and groffer2.sh.

* groffer.sh:
- Remove the second part of this script.  It is now in
groffer2.sh.
- $_GROFFER2_SH: New variable to point to the installed position
of `groffer2.sh'.  This position is presented using @@libdir@@.

* groffer2.sh: New script containing the second part of
groffer.sh. This script will be installed in the groffer library
directory @@libdir@@/groff/groffer, this might be
/usr/local/lib/groff/groffer/groffer2.sh for example.

* Makefile.sub:
- `groffer': Add replacement of @@libdir@@.
- `install_data': Add the installation of the groffer library
directory and groffer2.sh.
- `uninstall_sub': Delete the installed `groffer2.sh' and the
groffer library directory.

* README_SH:
- Remove the function list.
- Add argument options to the list of used commands.
- Documentation of the splitting of the script.
- Document the possible abbreviation of options.
@
text
@d7 7
a13 2
`groffer2.sh'.  `groffer.sh' is a short introductory script; it is
transformed by `make' into `groffer'; this will be installed in
d16 5
a20 5
`groffer2.sh' is a long main script with all functions that is called
by `groffer.sh' and `groffer'.  It is installed unchanged into
@@libdir@@/groff/groffer, which is usually /usr/local/lib/groff/groffer.
This script can be called with a different shell, using the option
`--shell'.  So it makes sense to split the script into two parts.
d39 5
a43 4
`dash', 'ksh', `pdksh', 'posh', and `zsh' without problems in Linux
Debian.  A shell can be tested by the `groffer' option `--shell', but
that will run only with groffer2.sh.  To start it directly from the
beginning under this shell the following command can be used.
d88 5
d109 1
d124 1
d132 1
a132 1
test -d -f -r -s -w -x
d233 1
a233 1
Last update: 30 July 2005
d238 1
a238 1
This file is part of groffer, which is part of groff.
d240 1
a240 1
groff is free software; you can redistribute it and/or modify it
d245 1
a245 1
groff is distributed in the hope that it will be useful, but WITHOUT
d251 2
a252 2
along with groff; see the files COPYING and LICENSE in the top
directory of the groff source.  If not, write to the Free Software
@


1.9
log
@

* release of groffer 0.9.19

* groffer.sh: extensions
- `mode x': Mode for the equivalent options `--x', `--mode x',
`--X' `--mode X', and the default mode.  The default assumes a
resolution of 75 dpi.  The default device for a resolution of 75
dpi is `X75-12', the default device for a resolution of 100 dpi is
`X100'.  The default geometry for the resolution of 100 dpi is set
to the width 800 dpi.
- `mode X': New mode for option -X only.
- `-V': Extent the `groff' output of -V by `groffer' specific
information (in main_display()).
- register_file(): Replace title `-' by `stdin'.
- $_DEBUG_KEEP_FILES: If set to `yes' the files in the temporary
directory are not deleted before the end trap.

* groffer.sh: get `zsh' to work as well
- tmp_create(): Use `: >file' for generating an empty file.
- rmdir: Replace `rmdir' by `rm -f -r'.
- eval: Add `eval' to many commands with variable arguments.

* groffer.sh: repair `debug'
- Print all debug output to stderr.
- $_FUNC_STACK: Built function call stack even when $_DEBUG is not
set.  Now the arguments are not added.
- $_DEBUG: If set to `yes' print 3 call stack events: the function
that is added with its arguments is printed with `+++ '
(func_push()); the call stack after the addition is printed with
`>>> ' (func_push()); the call stack after the removing is printed
with `<<< ' (func_pop()).
- error(): Always print the function call stack on errors.

* groffer.sh: Corrections
- $_groffer_run: Rename to $_GROFFER_RUN.
- $unset: Rename to $_UNSET.
- Repair test of `unset'.
- Repair test for `--shell'.  The script is now rerun under the
shell specified in the option argument.  This can increase the
speed.

* README_SH: `zsh' now works.

* groffer.man:
- Reformulate the information for the `groffer' specific details
of option `-V'.
- Add information on the debug process.
- Add information on the default devices in `x mode'.
- Minor corrections.
@
text
@d1 15
a15 1
Additional description for groffer.sh, the shell version of groffer
d20 6
a25 5
This shell script is compatible to both the GNU and the POSIX shell
and utilities.  Care was taken to restrict the programming technics
used here in order to achieve POSIX compatibility as far back as POSIX
P1003.2 Draft 11.2 of September 1991.  This draft is available at
http://www.funet.fi/pub/doc/posix/p1003.2/d11.2 in the internet.
d33 1
a33 1
The `groffer' script was tested under the shells `ash', `bash',
d35 3
a37 2
Debian.  A shell can be tested either by the `groffer' option
`--shell' or by the command
d39 1
a39 1
  <shell> groffer.sh <argument>...
d54 3
a56 1
  are accepted as non-option.
d72 2
a73 2
standard output.  So handle the output with `sed'.  If the output
contains `not found' map it to an empty string.
d78 2
a79 2
- As `unset' is not supported by all shells replace ist by `eval
  $unset' where this variable is `unset' if it exists and `:'
d86 3
d90 1
a90 1
The script uses the following commands:
d95 1
a95 1
bzip2
d103 5
a107 4
groff
grog
gs
gzip
d109 1
a109 1
man
d113 1
a113 1
rm
d115 3
a117 3
sed
set
sh
d119 1
a119 1
test
d124 3
d128 5
a132 3
to the usual GNU style command line (option clusters, long option
names with 2 `-' signs, mixing of options and non-option file names),
except that it is not possible to abbreviate long option names.
d149 1
a149 1
Survey of Functions defined in groffer.sh
d151 1
a151 1
Each funtion in groffer.sh has a description that starts with the
d158 1
d162 1
a162 1
<arg>      exactly 1 of this argument
d166 2
a167 75
for some function.  The internal functions are defined just after
their corresponding function; they are not mentioned in the following.

abort (<text>*)
base_name (<path>)
catz (<file>)
clean_up ()
diag (<text>*)
dirname_append (<path> [<dir...>])
dirname_chop (<path>)
do_filearg (<filearg>)
do_nothing ()
echo2 (<text>*)
error (<text>*)
get_first_essential (<arg>*)
is_dir (<name>)
is_empty (<string>)
is_equal (<string1> <string2>)
is_existing (<name>)
is_file (<name>)
is_non_empty_file (<name>)
is_not_dir (<name>)
is_not_empty (<string>)
is_not_equal (<string1> <string2>)
is_not_file (<name>)
is_not_prog (<name>)
is_not_writable (<name>)
is_not_yes (<string>)
is_prog (<name>)
is_writable (<name>)
is_yes (<string>)
leave ()
landmark (<text>)
list_append (<list> <element>...)
list_from_cmdline (<pre_name_of_opt_lists> [<cmdline_arg>...])
list_from_split (<string> <separator>)
list_get (<list>)
list_has (<list> <element>)
list_has_not (<list> <element>)
main_*(), see after the functions
man_do_filespec (<filespec>)
man_setup ()
man_register_file (<file> [<name> [<section>]])
man_search_section (<name> <section>)
man_set()
manpath_add_lang(<path> <language>)
manpath_add_system()
manpath_from_path ()
normalize_args (<shortopts> <longopts> <arg>*)
obj (<object> <call_name> <arg>...)
obj_data (<object>)
obj_from_output (<object> <call_name> <arg>...)
obj_set (<object> <data>)
path_chop (<path>)
path_clean (<path>)
path_contains (<path> <dir>)
path_not_contains (<path> <dir>)
path_split (<path>)
register_file (<filename>)
register_title (<filespec>)
res (<var_name> <function_name> <arg>...)
reset ()
save_stdin ()
string_contains (<string> <part>)
string_not_contains (<string> <part>)
tmp_cat ()
tmp_create (<suffix>?)
to_tmp (<filename>)
trap_clean ()
trap_set (<functionname>)
usage ()
version ()
warning (<string>)
whatis (<filename>)
where (<program>)
d220 1
a220 1
Last update: 4 July 2005
@


1.8
log
@

* release of groffer 0.9.18

* groffer.sh: further shell compatibility
- `echo': Remove options and possible options of `echo' by
preceding the argument with a character `x' that is removed by
`sed' or replace `echo' by `cat <<EOF'.  `echo -n' seems to be not
portable, so it is omitted.
- `for': Remove `;' from within `for' (because of ksh).
- `ls': Old UNIX systems echoed the error message to standard
output.  So handle the output with `sed'.  If the output contains
`not found' map it to an empty string.
- `true': Replace `true' by command `:'.  Remove test of `true'
(because `ash' refuses the redefinition of builtins even in an
unreachable `if' branch).
- `false': Remove test of `false'; it isn't used any more.
- `test': As `test -e' does not exist in Solaris 2.5 replace it by
`test -f || test -d'.
- `unset': `unset' is said to be not portable.  As `ash' protests
against the definition of the function `unset()' in the test of
`unset' replace the test by defining `$unset' to `unset' if it
exists and to `:' otherwise.  Use `eval $unset' instead of the
direct command `unset'.
- _get_opt_shell(): Replace `for' loop with `shift' by `while'.
- man_search_section(): Replace `for f in filename*' by a test on
the existence of `filename*'.
- `zsh' interprets `$...' as `"$..."'.  So `eval' must be called;
This cannot be used in `for i in $f', so it must be rewritten as
`for i in $(eval set x $f; shift; echo "$@@")'

* groffer.sh:
- `--X', `--x', `--mode=X', `--mode=x': Make these options
equivalent to chosing an X device by setting `-TX75-12'.  `-X' is
still equivalent to `groff -X'.
- main_init(): Choose the name of the temporary file by adding a
number using `expr' if it exists and cannot be removed.
- main_parse_args():Repair some options by replacing `$mpa_mode'
by `$_OPT_MODE'.
- catz(): Rename it to cat_z() to avoid problem with existing
programs.
- where(): Rename to where_is().
- $_CONFFILES: Rename to $_CONF_FILES.
- $_HAS_BZIP: export and preset it.

* groffer.man:
- Document the `X mode' changes.
- Add `@@g@@' to `troff'.

* README, README_SH, TODO:
- Add date line `Latest update:'.
- Add `...' quoting to essential terms.
- Add Emacs mode at the end.

* README_SH:
- Add documentation on the above compatibility changes.
- Add documentation on used commands.
- Mention the tested shells.

* Makefile.sub:
Readd `@@g@@'.
@
text
@d18 8
d29 1
a29 1
(look-up in Emacs-Help-Manuals).
a67 4
The `groffer' script was tested under the shells `ash', `bash',
`dash', 'ksh', `pdksh', and 'posh' without problems in Linux Debian.
`zsh' works, but produces a minor problem (in the modes dvi, pdf, ps,
and X, an empty page is added as first page.)
d265 1
a265 1
Last update: 1 July 2005
@


1.7
log
@

* groffer.sh: get rid of `local' in functions (non-POSIX)
- Replace local variables by variable names with a special prefix
that is an abbreviation of the corresponding function name (quasi-
local variables).
- Unset the quasi-local function variables before returning.
- _t_e_s_t_f_u_n_c_(): Remove tests for local and global
variables.
- Add quasi-local variables for saving the content of
single-character variables.
- Remove some unused local and global variables.
- Several variables were forgotten to make local.  They are now
made quasi-local.

* groffer.sh: other corrections
- $return_var: New function (after `eval') for an arbitrary
return value.
- obj*(): Add return modes.
- Rewrite tests for `true' and `false'.
- Add function names to error calls where it was forgotten.
- for: Replace `for x in "$@@"' by `for x'.
- set: Replace `set -- ...' by `set x ...; shift'.
- sed: Replace `\|.*|s|...|...|' by `s|...|...|'.

* README_SH:
- Add information on the removing of `local'.
- New section for non-POSIX shell restrictions.
@
text
@d23 1
a23 1
- The command parts `then', `else', and `do' are written each on a
d26 1
a26 1
- Replace `for i in "$@@"' by `for i'.
d32 65
a96 3
- The name of the variable in `for' is chosen as a single character.
  The content of such variables is not safe.  So it is often stored in
  an additional quasi-local variable.
a146 1
echo2n (<text>*)
d261 2
d282 7
@


1.6
log
@

* release of groffer 0.9.16

* groffer.sh: Place each `then', `else', and `do' on a line of its
own because some shells do not support the mixture mode.

* groffer.man: Add section `BUGS'.

* README_SH:
- Add compatibility information.
- Correct documentation for function arguments.

* groffer.sh: $_NULL_DEV: Replace /dev/null by $_NULL_DEV which is
either /dev/null or NUL if /dev/null does not exist.


* Makefile.sub: $(RM): Define it to `rm -f' because not all `make'
programs have it predefined.
@
text
@d9 8
a16 5
P1003.2 Draft 11.2 of September 1991, but including the local
variables in functions that were eliminated only in this draft.  This
draft is available at http://www.funet.fi/pub/doc/posix/p1003.2/d11.2
in the internet.  So `groffer' should be compatible to most actual
Bourne style shells.
d19 16
a34 3
restrictions were done. The name of the variable in `for' is chosen as
a single character.  The content of such a variable is regarded as
non-local. Furthermore `then', `else', and `do' get a line of their own.
d65 5
a69 4
<>?     0 or 1 of these arguments
<>*     arbitrarily many such arguments, incl. none
<>+     one or more such arguments
<>      exactly 1 of this argument
@


1.5
log
@

* All affected files: Update postal address of FSF.
@
text
@d15 5
d42 8
a49 3
The elements specified within paranthesis `(<>)' give hints to what
the arguments are meant to be; the argument names are irrelevant.
<>?     0 or 1
d52 1
a52 1
<>      exactly 1
d133 1
a133 1
External non-groffer Environment Variables
d135 3
a137 2
If these variables are exported in the script the `ash' shell coughs
when calling `groff' in `main_display()'.
d145 1
a145 1
$PATH:			Path for the programs called (: list).
@


1.4
log
@

* release of groffer 0.9.13

* groffer.sh:
- first line: Add space to `#! /bin/sh'.
- $_VIEWER_DVI: Add `kdvi'.
- $_VIEWER_PDF: Add `kghostview', `ggv', and `kpdf'.
- $_VIEWER_PS: Add `kghostview' and `ggv'.
- $_modefile: For the output file name, add extension .ps for ps
mode and .dvi for dvi mode.  This exists already for the html and
pdf modes.
- Update some parts of the documentation.

* README, README_SH:
- Move some parts on usage from README_SH to README.
- Reformulate several parts of both files.

* groffer.man: update
@
text
@d190 1
a190 1
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@


1.3
log
@

* release of groffer 0.9.12

* groffer.sh:
- main_init(): Rewriting of the creation of the temporary
directory to ensure that it cannot be made writable apart from the
user.  If the directory already exists and cannot be removed then
append `X' to the directory name.
- is_non_empty_file(): fix it to use POSIX `test -s'.
- is_existing(): new function.
- POSIX `rm -f -r': use this in `clean_up()' and `main_init()'.
- `--macro-file': remove this unused long option.
- `-V', `--source', `--device': move these from groff options
to groffer options.
- `$_TMP_DIR_SUB': remove this unused variable.
@
text
@d1 1
a1 1
Description of groffer.sh, the shell version of groffer
a2 1
Display groff files and man pages on X or tty, even when compressed.
d4 1
d6 13
a18 1
Usage
d20 5
a24 29
Input comes from either standard input or command line parameters that
represent names of exisiting roff files or standardized specifications
for searching man pages.  All of these can be compressed in a format
that is decompressible by `gzip', including `.gz', `bz2', and `.Z'.

The following displaying modes are available:
- Display formatted input with the X roff viewer `gxditview',
- with a Prostcript viewer,
- with a dvi viewer,
- with a web browser.
- Display formatted input in plain text mode.
- Run a pager on the formatted input in a text terminal (tty).
- Generate output for some groff device on stdout without a viewer.
- Output only the source code without any groff processing.
- Generate the troff intermediate output on standard output
  without groff postprocessing.
By default, the program tries to display with `gxditview' as graphical
device, `tty' mode with a pager is tried as text display.


Several File Arguments

So far, `groffer' bundles all filespec parameters into a single output
file in the same way as `groff'.  The disadvantage of this is that all
file name arguments must have the same groff language.

To change this, the option parsing must be revised for large parts.
It seems that this would create incompatibilities, so the actual
option strategy is kept.
a34 25
Shell Compatibility

This shell script is compatible to the both the GNU and the POSIX
shell and utilities.  Care was taken to restrict the programming
technics used here in order to achieve POSIX compatibility as far back
as POSIX P1003.2 Draft 11.2 of September 1991.

The only non-builtin used here is POSIX `sed'.  This script was tested
under `bash', `ash', and `ksh'.  The speed under `ash' is more than
double when compared to the larger shells.  The new version of `ash'
taken from `dash' produces strange errors, so the automatic call of
`ash' was removed.

This script provides its own option parser.  It is compatible to the
usual GNU style command line (option clusters, long options, mixing of
options and non-option file names), except that it is not possible to
abbreviate long option names.

The flexible mixing of options and file names in GNU style is always
possible, even if the environment variable `$POSIXLY_CORRECT' is set
to a non-empty value.  This disables the rather wicked POSIX behavior
to terminate option parsing when the first non-option command line
argument is found.


d48 2
a49 2
abort (text>*)
base_name (path)
d52 1
a52 1
diag (text>*)
d172 1
a172 1
Copyright (C) 2003,2004 Free Software Foundation, Inc.
@


1.2
log
@

* release of groffer 0.9.10

* groffer.sh:
- Remove automatic call of `ash' due to inconsistencies of
different ash versions.
- In the first run, add recognition of `--shell' lines in the
groffer configuration files.  To configure an external shell in
a configuration file, a line starting with `--shell' is
necessary.
- list_from_cmdline(): Simplify the arguments.
- As $POSIXLY_CORRECT is internally set to `y' by some GNU
`/bin/sh' shells the following 2 fixes are necessary:
-- `sed': Empty patterns are not allowed with $POSIXLY_CORRECT
set; so move the address information before the `s' command to the
pattern after the command, and write `.*' to the address field.
-- list_from_cmdline(): Remove the strange $POSIXLY_CORRECT style
to finish the option processing after the first non-option
argument; use the flexible GNU mixing of options and file names
instead.

* groffer.man:
- Remove any hints on `ash'.
- Add minus line behavior of `--shell' for configuration and add a
corresponding example.
- Update the information on $POSIXLY_CORRECT.
@
text
@d101 1
d112 1
d132 4
@


1.1
log
@

Update to groffer 0.9.7.
@
text
@d51 2
a52 2
technics used here in order to achieve POSIX compatibility as far
back as POSIX P1003.2 Draft 11.2 of September 1991.
d54 5
a58 3
The only non-builtin used here is POSIX `sed'.  This script was
tested under `bash', `ash', and `ksh'.  The speed under `ash' is
more than double when compared to the larger shells.
d61 9
a69 8
usual GNU style command line (option clusters, long options, mixing
of options and non-option file names), except that it is not
possible to abbreviate long option names.

The mixing of options and file names can be prohibited by setting
the environment variable `$POSIXLY_CORRECT' to a non-empty value.
This enables the rather wicked POSIX behavior to terminate option
parsing when the first non-option command line argument is found.
d81 3
a83 4
A function that starts with an underscore `_' is an internal
function for some function.  The internal functions are defined just
after their corresponding function; they are not mentioned in the
following.
d115 1
a115 1
list_from_cmdline (<s_n> <s_a> <l_n> <l_n> [<cmdline_arg>...])
@

