summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2000-11-15 22:29:38 +0000
committerwlemb <wlemb>2000-11-15 22:29:38 +0000
commita097d2a35efc38236f237aa20824479c59b7dc84 (patch)
treed038b1a0f7cccef7411d263b46fdffd84a8aebc1
parentc14e595045dfbc9ef97ef446ce072c0b248a9c5d (diff)
downloadgroff-a097d2a35efc38236f237aa20824479c59b7dc84.tar.gz
In all programs, make -v return immediately with exit status 0 to
be compliant with the GNU standard. * src/devices/grodvi/dvi.cc (main), src/devices/grohtml2/post-html.cc (main), src/devices/grolbp/lbp.cc (main), src/devices/grolj4/lj4.cc (main), src/devices/grops/ps.cc (main), src/devices/grotty/tty.cc (main) src/preproc/eqn/main.cc (main), src/preproc/grn/main.cc (main), src/preproc/html2/pre-html.cc (main), src/preproc/pic/main.cc (main), src/preproc/refer/refer.cc (main), src/preproc/soelim/soelim.cc (main), src/preproc/tbl/main.cc (main), src/roff/groff/groff.cc (main), src/roff/troff/input.cc (main): Implement it. * NEWS: Updated. * src/roff/groff/groff.cc (main): Add copyright notice. Add refer and postprocessors to the -v option. * src/roff/grog/grog.pl: Implement -v. * src/roff/grog/Makefile.sub (grog): Use @VERSION@. * src/roff/grog/grog.man, doc/groff.texinfo: Updated. * src/roff/nroff/nroff.sh: Implement -v. * src/roff/nroff/Makefile.sub (nroff): Use @VERSION@. * src/roff/nroff/nroff.man: Updated. * src/preproc/eqn/main.cc (main): Fix comment typo. * MORE.STUFF: Added info about djgpp port of grap.
-rw-r--r--ChangeLog32
-rw-r--r--MORE.STUFF7
-rw-r--r--NEWS10
-rw-r--r--doc/groff.texinfo7
-rw-r--r--src/devices/grodvi/dvi.cc1
-rwxr-xr-xsrc/devices/grohtml/ChangeLog5
-rwxr-xr-xsrc/devices/grohtml/html.cc1
-rwxr-xr-xsrc/devices/grohtml2/post-html.cc1
-rw-r--r--src/devices/grolbp/lbp.cc1
-rw-r--r--src/devices/grolj4/lj4.cc1
-rw-r--r--src/devices/grops/ps.cc1
-rw-r--r--src/devices/grotty/tty.cc1
-rw-r--r--src/preproc/eqn/main.cc3
-rw-r--r--src/preproc/grn/main.cc1
-rwxr-xr-xsrc/preproc/html2/pre-html.cc1
-rw-r--r--src/preproc/pic/main.cc1
-rw-r--r--src/preproc/refer/refer.cc2
-rw-r--r--src/preproc/soelim/soelim.cc1
-rw-r--r--src/preproc/tbl/main.cc1
-rw-r--r--src/roff/groff/groff.cc31
-rw-r--r--src/roff/grog/Makefile.sub6
-rw-r--r--src/roff/grog/grog.man6
-rw-r--r--src/roff/grog/grog.pl7
-rw-r--r--src/roff/grog/grog.sh5
-rw-r--r--src/roff/nroff/Makefile.sub3
-rw-r--r--src/roff/nroff/nroff.man3
-rw-r--r--src/roff/nroff/nroff.sh3
-rw-r--r--src/roff/troff/input.cc1
28 files changed, 124 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index c95dbb54..231a6e1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2000-11-15 Werner LEMBERG <wl@gnu.org>
+
+ In all programs, make -v return immediately with exit status 0 to
+ be compliant with the GNU standard.
+
+ * src/devices/grodvi/dvi.cc (main),
+ src/devices/grohtml2/post-html.cc (main),
+ src/devices/grolbp/lbp.cc (main), src/devices/grolj4/lj4.cc
+ (main), src/devices/grops/ps.cc (main), src/devices/grotty/tty.cc
+ (main) src/preproc/eqn/main.cc (main), src/preproc/grn/main.cc
+ (main), src/preproc/html2/pre-html.cc (main),
+ src/preproc/pic/main.cc (main), src/preproc/refer/refer.cc (main),
+ src/preproc/soelim/soelim.cc (main), src/preproc/tbl/main.cc
+ (main), src/roff/groff/groff.cc (main), src/roff/troff/input.cc
+ (main): Implement it.
+ * NEWS: Updated.
+
+ * src/roff/groff/groff.cc (main): Add copyright notice. Add refer
+ and postprocessors to the -v option.
+
+ * src/roff/grog/grog.pl: Implement -v.
+ * src/roff/grog/Makefile.sub (grog): Use @VERSION@.
+ * src/roff/grog/grog.man, doc/groff.texinfo: Updated.
+
+ * src/roff/nroff/nroff.sh: Implement -v.
+ * src/roff/nroff/Makefile.sub (nroff): Use @VERSION@.
+ * src/roff/nroff/nroff.man: Updated.
+
+ * src/preproc/eqn/main.cc (main): Fix comment typo.
+
+ * MORE.STUFF: Added info about djgpp port of grap.
+
2000-11-14 Werner LEMBERG <wl@gnu.org>
* src/roff/grog/grog.{pl,sh}: Implemented -C switch for compatibility
diff --git a/MORE.STUFF b/MORE.STUFF
index 5b0b1dcf..c40e7024 100644
--- a/MORE.STUFF
+++ b/MORE.STUFF
@@ -34,6 +34,13 @@ can be found at
http://www.lunabase.org/~faber/Vault/software/grap/
+A djgpp port which runs on MS-DOS and all Win32 systems (Win95, Win98,
+WinNT) done by Kees Zeelenberg <c.zeelenberg@hccnet.nl> is available from
+
+ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/
+
+It is intended to be used with the djgpp port of groff.
+
plot2dev
--------
diff --git a/NEWS b/NEWS
index 7ed3b609..4a0a7d31 100644
--- a/NEWS
+++ b/NEWS
@@ -49,12 +49,19 @@ The new escape sequence \B'...' is an analogon to `\A': If the string within
the delimiters is a valid numeric expression, return character `1', and `0'
otherwise.
+Nroff
+-----
+
+Option -v shows the version number.
+
Grog
----
The grog script will now work in non-compatibility mode also (which is the
default). As usual, use the `-C' option to activate compatibility mode.
+Option -v shows the version number.
+
Grops
-----
@@ -86,6 +93,9 @@ before the standard tmac directory. Wrapper files for system-specific macro
packages (if necessary) are put into /usr/local/lib/groff/site-tmac; this
directory will be searched after the local tmac directory.
+All programs which have option `-v' implemented will now exit immediately
+after showing the version number.
+
VERSION 1.16.1
==============
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 88bb1ac8..03393cec 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -1410,8 +1410,9 @@ The options generated are one of @option{-e}, @option{-man},
A special file name @file{-} is taken to refer to the standard input.
If no files are specified the standard input will be read. Any
specified options will be included in the printed command. No space is
-allowed between options and their arguments. The only option recognized
-is @option{-C} (which is also passed on) to enable compatibility mode.
+allowed between options and their arguments. The only options recognized
+are @option{-C} (which is also passed on) to enable compatibility mode, and
+@option{-v} (if it is the only parameter) to print the version number.
For example,
@@ -6353,7 +6354,7 @@ name.
This would be called as
@example
-.vl $Id: groff.texinfo,v 1.54 2000/11/14 15:36:18 wlemb Exp $
+.vl $Id: groff.texinfo,v 1.55 2000/11/15 22:29:39 wlemb Exp $
@end example
@xref{Request Arguments}.
diff --git a/src/devices/grodvi/dvi.cc b/src/devices/grodvi/dvi.cc
index 305470e1..9620ed04 100644
--- a/src/devices/grodvi/dvi.cc
+++ b/src/devices/grodvi/dvi.cc
@@ -858,6 +858,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "grodvi version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'w':
diff --git a/src/devices/grohtml/ChangeLog b/src/devices/grohtml/ChangeLog
index 9cc5ec05..9eea2785 100755
--- a/src/devices/grohtml/ChangeLog
+++ b/src/devices/grohtml/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-15 Werner LEMBERG <wl@gnu.org>
+
+ * html.cc (main): Make -v exit immediately to be compliant with
+ the GNU standard.
+
2000-08-23 Gaius Mulley <gaius@glam.ac.uk>
* html.cc (char_translate_to_html): New function.
diff --git a/src/devices/grohtml/html.cc b/src/devices/grohtml/html.cc
index 4c28f4c6..729831fc 100755
--- a/src/devices/grohtml/html.cc
+++ b/src/devices/grohtml/html.cc
@@ -6546,6 +6546,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "grohtml version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'a':
diff --git a/src/devices/grohtml2/post-html.cc b/src/devices/grohtml2/post-html.cc
index 1693f106..b8520b91 100755
--- a/src/devices/grohtml2/post-html.cc
+++ b/src/devices/grohtml2/post-html.cc
@@ -64,6 +64,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "post-grohtml version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'F':
diff --git a/src/devices/grolbp/lbp.cc b/src/devices/grolbp/lbp.cc
index 6633ab65..23de5161 100644
--- a/src/devices/grolbp/lbp.cc
+++ b/src/devices/grolbp/lbp.cc
@@ -720,6 +720,7 @@ int main(int argc, char **argv)
fprintf(stderr, "grolbp version %s\n",\
version_string);
fflush(stderr);
+ exit(0);
break;
};
case 'o' : {
diff --git a/src/devices/grolj4/lj4.cc b/src/devices/grolj4/lj4.cc
index 0c23a456..113be2f5 100644
--- a/src/devices/grolj4/lj4.cc
+++ b/src/devices/grolj4/lj4.cc
@@ -642,6 +642,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "grolj4 version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'F':
diff --git a/src/devices/grops/ps.cc b/src/devices/grops/ps.cc
index 302f81a4..a4f4e613 100644
--- a/src/devices/grops/ps.cc
+++ b/src/devices/grops/ps.cc
@@ -1489,6 +1489,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "grops version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'c':
diff --git a/src/devices/grotty/tty.cc b/src/devices/grotty/tty.cc
index 63d8fb8f..820339a0 100644
--- a/src/devices/grotty/tty.cc
+++ b/src/devices/grotty/tty.cc
@@ -414,6 +414,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "grotty version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'b':
diff --git a/src/preproc/eqn/main.cc b/src/preproc/eqn/main.cc
index e475eb9d..f80f3cba 100644
--- a/src/preproc/eqn/main.cc
+++ b/src/preproc/eqn/main.cc
@@ -253,7 +253,7 @@ int main(int argc, char **argv)
case 'C':
compatible_flag = 1;
break;
- case 'R': // don't load eqnchar
+ case 'R': // don't load eqnrc
load_startup_file = 0;
break;
case 'M':
@@ -264,6 +264,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU eqn version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'd':
diff --git a/src/preproc/grn/main.cc b/src/preproc/grn/main.cc
index bcbb2df8..56c4e410 100644
--- a/src/preproc/grn/main.cc
+++ b/src/preproc/grn/main.cc
@@ -265,6 +265,7 @@ main(int argc,
extern const char *Version_string;
fprintf(stderr, "GNU grn version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'C': /* compatibility mode */
diff --git a/src/preproc/html2/pre-html.cc b/src/preproc/html2/pre-html.cc
index 79943e4a..0435edb7 100755
--- a/src/preproc/html2/pre-html.cc
+++ b/src/preproc/html2/pre-html.cc
@@ -726,6 +726,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU pre-grohtml version %s\n", Version_string);
fflush(stderr);
+ exit(0);
}
} else {
ok = do_file(argv[i]);
diff --git a/src/preproc/pic/main.cc b/src/preproc/pic/main.cc
index 1536513a..e9444831 100644
--- a/src/preproc/pic/main.cc
+++ b/src/preproc/pic/main.cc
@@ -566,6 +566,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU pic version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'z':
diff --git a/src/preproc/refer/refer.cc b/src/preproc/refer/refer.cc
index 70c696f4..c4aabe99 100644
--- a/src/preproc/refer/refer.cc
+++ b/src/preproc/refer/refer.cc
@@ -339,7 +339,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU refer version %s\n", Version_string);
fflush(stderr);
- opt++;
+ exit(0);
break;
}
case '-':
diff --git a/src/preproc/soelim/soelim.cc b/src/preproc/soelim/soelim.cc
index 257fc88a..c1a03e0c 100644
--- a/src/preproc/soelim/soelim.cc
+++ b/src/preproc/soelim/soelim.cc
@@ -76,6 +76,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU soelim version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'C':
diff --git a/src/preproc/tbl/main.cc b/src/preproc/tbl/main.cc
index d70345e2..46fc4297 100644
--- a/src/preproc/tbl/main.cc
+++ b/src/preproc/tbl/main.cc
@@ -1466,6 +1466,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU tbl version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'T':
diff --git a/src/roff/groff/groff.cc b/src/roff/groff/groff.cc
index 1844f83c..17c03f95 100644
--- a/src/roff/groff/groff.cc
+++ b/src/roff/groff/groff.cc
@@ -167,14 +167,29 @@ int main(int argc, char **argv)
break;
case 'v':
case 'C':
- commands[SOELIM_INDEX].append_arg(buf);
- commands[PIC_INDEX].append_arg(buf);
- commands[GRAP_INDEX].append_arg(buf);
- commands[TBL_INDEX].append_arg(buf);
- commands[GRN_INDEX].append_arg(buf);
- commands[EQN_INDEX].append_arg(buf);
- commands[TROFF_INDEX].append_arg(buf);
- break;
+ {
+ extern const char *Version_string;
+ fprintf(stderr,
+ "GNU groff version %s\n", Version_string);
+ fprintf(stderr,
+ "Copyright (C) 2000 Free Software Foundation, Inc.\n"
+ "GNU groff comes with ABSOLUTELY NO WARRANTY.\n"
+ "You may redistribute copies of groff and its subprograms\n"
+ "under the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the file named COPYING.\n");
+ fprintf(stderr, "\ncalled subprograms:\n\n");
+ fflush(stderr);
+ commands[SOELIM_INDEX].append_arg(buf);
+ commands[REFER_INDEX].append_arg(buf);
+ commands[PIC_INDEX].append_arg(buf);
+ commands[GRAP_INDEX].append_arg(buf);
+ commands[TBL_INDEX].append_arg(buf);
+ commands[GRN_INDEX].append_arg(buf);
+ commands[EQN_INDEX].append_arg(buf);
+ commands[TROFF_INDEX].append_arg(buf);
+ commands[POST_INDEX].append_arg(buf);
+ break;
+ }
case 'N':
commands[EQN_INDEX].append_arg(buf);
break;
diff --git a/src/roff/grog/Makefile.sub b/src/roff/grog/Makefile.sub
index de3dd4b8..054d06e1 100644
--- a/src/roff/grog/Makefile.sub
+++ b/src/roff/grog/Makefile.sub
@@ -7,10 +7,12 @@ all: grog
grog: grog.pl grog.sh
if test -n "$(PERLPATH)" && test -f "$(PERLPATH)"; then \
rm -f $@; \
- sed -e 's;/usr/bin/perl;$(PERLPATH);' $(srcdir)/grog.pl >$@; \
+ sed -e "s|/usr/bin/perl|$(PERLPATH)|" \
+ -e "s|@VERSION@|$(version)$(revision)|" $(srcdir)/grog.pl >$@; \
else \
rm -f $@; \
- sed -e 's/@g@/$(g)/g' \
+ sed -e "s|@g@|$(g)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|" \
-e $(SH_SCRIPT_SED_CMD) $(srcdir)/grog.sh >$@; \
fi
chmod +x $@
diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man
index 6935058b..4a2d3114 100644
--- a/src/roff/grog/grog.man
+++ b/src/roff/grog/grog.man
@@ -58,9 +58,11 @@ is taken to refer to the standard input.
If no files are specified the standard input will be read.
Any specified options will be included in the printed command.
No space is allowed between options and their arguments.
-The only option recognized is
+The only options recognized are
.B \-C
-(which is also passed on) to enable compatibility mode.
+(which is also passed on) to enable compatibility mode, and
+.B \-v
+to print the version number.
.LP
For example,
.IP
diff --git a/src/roff/grog/grog.pl b/src/roff/grog/grog.pl
index 3e15f59b..b9493e3e 100644
--- a/src/roff/grog/grog.pl
+++ b/src/roff/grog/grog.pl
@@ -13,6 +13,7 @@ push(@command, "groff");
while ($ARGV[0] =~ /^-./) {
$arg = shift(@ARGV);
$sp = "" if $arg eq "-C";
+ &usage(0) if $arg eq "-v";
last if $arg eq "--";
push(@command, $arg);
}
@@ -126,6 +127,12 @@ sub process {
close(FILE);
}
+sub usage {
+ local($exit_status) = $_;
+ print "GNU groff version @VERSION@\n";
+ exit $exit_status;
+}
+
if ($pic || $tbl || $eqn || $grn || $grap || $refer) {
$s = "-";
$s .= "s" if $soelim;
diff --git a/src/roff/grog/grog.sh b/src/roff/grog/grog.sh
index d52798cb..181fce4a 100644
--- a/src/roff/grog/grog.sh
+++ b/src/roff/grog/grog.sh
@@ -15,7 +15,10 @@ do
-)
break;;
-C)
- sp=; opts="$opts -C"; shift;;
+ sp=; opts="$opts -C"; shift; break;;
+ -v)
+ echo "GNU grog version @VERSION@"
+ exit 0;;
-*)
opts="$opts $arg"; shift;;
*)
diff --git a/src/roff/nroff/Makefile.sub b/src/roff/nroff/Makefile.sub
index 8862383b..e3b43665 100644
--- a/src/roff/nroff/Makefile.sub
+++ b/src/roff/nroff/Makefile.sub
@@ -7,7 +7,8 @@ all: nroff
nroff: nroff.sh
rm -f $@
sed -e 's|@BINDIR@|$(bindir)|g' \
- -e $(SH_SCRIPT_SED_CMD) $(srcdir)/nroff.sh >$@
+ -e $(SH_SCRIPT_SED_CMD) \
+ -e 's|@VERSION@|$(version)$(revision)|' $(srcdir)/nroff.sh >$@
chmod +x $@
install_data: nroff
diff --git a/src/roff/nroff/nroff.man b/src/roff/nroff/nroff.man
index 7a1a1c4b..c021316b 100644
--- a/src/roff/nroff/nroff.man
+++ b/src/roff/nroff/nroff.man
@@ -30,6 +30,7 @@ the original English.
.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
.el .RB "[\ " "\\$1" "\ ]"
..
+.OP \-v
.OP \-h
.OP \-i
.OP \-m name
@@ -88,6 +89,8 @@ Options
.BR groff .
.B \-S
is passed by default.
+.B \-v
+shows the version number.
.SH ENVIRONMENT
.TP
.SM
diff --git a/src/roff/nroff/nroff.sh b/src/roff/nroff/nroff.sh
index d36e0a07..723ae176 100644
--- a/src/roff/nroff/nroff.sh
+++ b/src/roff/nroff/nroff.sh
@@ -66,6 +66,9 @@ for i
# Solaris 2.2 `man' uses -u0; ignore it,
# since `less' and `more' can use the emboldening info.
;;
+ -v)
+ echo "GNU nroff version @VERSION@"
+ exit 0 ;;
--)
shift
break ;;
diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc
index b9cd5c84..1ffd6cb5 100644
--- a/src/roff/troff/input.cc
+++ b/src/roff/troff/input.cc
@@ -5870,6 +5870,7 @@ int main(int argc, char **argv)
extern const char *Version_string;
fprintf(stderr, "GNU troff version %s\n", Version_string);
fflush(stderr);
+ exit(0);
break;
}
case 'T':