diff options
author | wlemb <wlemb> | 2004-03-01 21:22:01 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2004-03-01 21:22:01 +0000 |
commit | b60ed8679f2a3695d4a46c881504e3d8d07517c3 (patch) | |
tree | d53fe3431fef13bcdc28f3833eb5c096ef7799e3 /src | |
parent | e1b4dc1840411a9a93c7b626b41295c604227d78 (diff) | |
download | groff-b60ed8679f2a3695d4a46c881504e3d8d07517c3.tar.gz |
* src/devices/grolj4/lj4.cpp (main): Fix argument of getopt_long.
s/operand/argument/ in error message.
* src/roff/groff/groff.cpp (main): Don't allow option -o if -Thtml
is in use.
* tmac/s.tmac (XE): Fix error message.
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/grolj4/lj4.cpp | 15 | ||||
-rw-r--r-- | src/roff/groff/groff.cpp | 12 |
2 files changed, 16 insertions, 11 deletions
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp index 99a675df..83bb877b 100644 --- a/src/devices/grolj4/lj4.cpp +++ b/src/devices/grolj4/lj4.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1994, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -611,7 +612,7 @@ int main(int argc, char **argv) { "version", no_argument, 0, 'v' }, { NULL, 0, 0, 0 } }; - while ((c = getopt_long(argc, argv, ":c:d:F:I:l:p:vw:", long_options, NULL)) + while ((c = getopt_long(argc, argv, "c:d:F:I:lp:vw:", long_options, NULL)) != EOF) switch(c) { case 'l': @@ -625,7 +626,7 @@ int main(int argc, char **argv) fprintf(stderr, "duplex assumed to be long-side\n"); duplex_flag = 1; } else - fprintf(stderr, "option -%c requires an operand\n", optopt); + fprintf(stderr, "option -%c requires an argument\n", optopt); fflush(stderr); break; case 'd': @@ -647,11 +648,9 @@ int main(int argc, char **argv) break; } case 'v': - { - printf("GNU grolj4 (groff) version %s\n", Version_string); - exit(0); - break; - } + printf("GNU grolj4 (groff) version %s\n", Version_string); + exit(0); + break; case 'F': font::command_line_font_dir(optarg); break; diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp index 80fab05d..0205fc9a 100644 --- a/src/roff/groff/groff.cpp +++ b/src/roff/groff/groff.cpp @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -114,6 +115,7 @@ int main(int argc, char **argv) int zflag = 0; int iflag = 0; int Xflag = 0; + int oflag = 0; int safer_flag = 1; int opt; const char *command_prefix = getenv("GROFF_COMMAND_PREFIX"); @@ -246,8 +248,9 @@ int main(int argc, char **argv) else Fargs = optarg; break; - case 'f': case 'o': + oflag = 1; + case 'f': case 'm': case 'r': case 'd': @@ -353,8 +356,11 @@ int main(int argc, char **argv) } commands[TROFF_INDEX].append_arg("-T", device); // html renders equations as images via ps - if (strcmp(device, "html") == 0) + if (strcmp(device, "html") == 0) { + if (oflag) + fatal("`-o' option is invalid with device `html'"); commands[EQN_INDEX].append_arg("-Tps:html"); + } else commands[EQN_INDEX].append_arg("-T", device); |