[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff/src/roff/grog grog.man
From: |
Eric S. Raymond |
Subject: |
[Groff-commit] groff/src/roff/grog grog.man |
Date: |
Fri, 02 Feb 2007 11:47:47 +0000 |
CVSROOT: /sources/groff
Module name: groff
Changes by: Eric S. Raymond <esr> 07/02/02 11:47:47
Modified files:
src/roff/grog : grog.man
Log message:
Converted to use .SY/.OP/.YS. Conversion checked using the protocol
described in tmac/TESTING-HINTS.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/grog/grog.man?cvsroot=groff&r1=1.12&r2=1.13
Patches:
Index: grog.man
===================================================================
RCS file: /sources/groff/groff/src/roff/grog/grog.man,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- grog.man 6 Nov 2006 17:57:21 -0000 1.12
+++ grog.man 2 Feb 2007 11:47:47 -0000 1.13
@@ -1,9 +1,4 @@
.TH GROG @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-grog \- guess options for groff command
-.SH SYNOPSIS
-.\" The .SH was moved to this place in order to appease `apropos'.
-.
.\" --------------------------------------------------------------------
.\" Legalize
.\" --------------------------------------------------------------------
@@ -16,16 +11,16 @@
Last Update: 6 Nov 2006
..
-.de copyleft
+.de co
Copyright (C) 1989-2000,2001,2002,2003,2006
Free Software Foundation, Inc.
.
-Written by
-.MTO "" "James Clark" .
+Written by James Clark.
Maintained by
-.MTO "address@hidden" "Werner Lemberg" .
-Rewritten and put under GPL by
-.MTO "" "Bernd Warken" .
+.MT address@hidden .
+Werner Lemberg
+.ME
+Rewritten and put under GPL by Bernd Warken.
.
.
.P
@@ -65,300 +60,43 @@
..
.
.\" --------------------------------------------------------------------
-.\" Setup
-.\" --------------------------------------------------------------------
-.
-.mso www.tmac
-.
-.if n \{\
-. mso tty-char.tmac
-. ftr CR R
-. ftr CI I
-. ftr CB B
-.\}
-.
-.if '\*[.T]'dvi' \{\
-. ftr CB CW
-.\}
-.
-.ds Ellipsis "\&.\|.\|.\""
-.
-.\" --------------------------------------------------------------------
-.\" configuration of prompt for `.Shell_cmd'* macros
-.ds grog:Shell_cmd.prompt_text sh#\" prompt for shell commands
-.ds grog:Shell_cmd_base.prompt_font I\" font for prompts
-.
-.\" automatically determine setup from the configuration above
-.als @f grog:Shell_cmd_base.prompt_font\"
-.als @t grog:Shell_cmd.prompt_text\"
-.ds grog:Shell_cmd.prompt address@hidden@t]\f[]\" needed
-.nr @w \w'\*[grog:Shell_cmd.prompt]'\"
-.ft address@hidden
-.\" Full prompt width is maximum of texts plus 1m
-.nr grog:Shell_cmd_base.prompt_width (address@hidden>address@hidden)\" needed
-.ft
-.rm @f
-.rm @t
-.rr @w
-.
-.
-.\" --------------------------------------------------------------------
-.\" static register for inter-macro communication in `.Synopsis'*
-.nr grog:Synopsis.level 0
-.
-.\" --------------------------------------------------------------------
-.\" Macro definitions
-.
-.\" Ignore all arguments like a comment, even after a .eo call.
-.de c
-..
-.c --------------------------------------------------------------------
-.c .Synopsis ()
-.c
-.c Begin a synopsis section, to be ended by a ./Synopsis macro.
-.c
-.de Synopsis
-. if (\\n[grog:Synopsis.level] > 0) \
-. Error .\\$0: previous .Synopsis was not closed by ./Synopsis.
-. nh
-. ds @1 \\$1\"
-. nr @old_indent \\n(.i
-. ad l
-. in +\w'address@hidden'u
-. ti address@hidden
-. B address@hidden
-. rr @old_indent
-. rm @1
-. nr grog:Synopsis.level +1\" marker for ./Synopsis
-..
-.c --------------------------------------------------------------------
-.c ./Synopsis ()
-.c
-.c Close a synopsis section opened by the previous .Synopsis macro.
-.c
-.de /Synopsis
-. if (\\n[grog:Synopsis.level] <= 0) \
-. Error .\\$0: no previous call of .Synopsis
-. br
-. ad
-. in
-. hy
-. nr grog:Synopsis.level -1
-..
-.c --------------------------------------------------------------------
-.c .Opt_alt ([<minus> <opt>]... [<arg> [<punct>]])
-.c
-.c Alternate options separated by a vertical bar.
-.c
-.c Arguments:
-.c minus: either `-' or `--' (font CB).
-.c opt: a name for an option, empty allowed (font CB).
-.c arg: optionally, the argument to the option (font I).
-.c punct: optional punctuation (in the starting font).
-.c Result:
-.c The minus/opt argument pairs, each
-.c separated by a vertical bar `|', optionally add 'arg', separated
-.c a space character ` '.
-.c
-.c Example:
-.c .Opt_alt - T -- device -- device-troff device .
-.c results in
-.c -T|--device|--device-troff device.
-.c
-.de Opt_alt
-. Opt_alt_base "" | "" \\$@
-..
-.c --------------------------------------------------------------------
-.c .Opt_alt_base (<pre> <sep> <post> [<minus> <opt>]... [arg [punct]])
-.c
-.c Alternating options; base macro for many others; do not use directly.
-.c
-.c Arguments:
-.c <pre>: prefix, result is preceded by this.
-.c <sep>: separator between minus/opt pairs.
-.c <post>: postfix, is appended to the result.
-.c <minus>: either `-' or `--' (font CB).
-.c <opt>: a name for an option, empty allowed (font CB).
-.c <arg>: optionally, the argument to the option (font I).
-.c <punct>: optional punctuation (in the starting font).
-.c Result:
-.c String `<pre>' followed by the <minus>/<opt> argument pairs, each
-.c separated by string `<sep>', optionally add '<arg>', separated by
-.c a single space ` ', followed by the string `<post>'. Terminated
-.c by the optional punctuation <punct>.
-.c
-.de Opt_alt_base
-. nr @font \\n[.f]\"
-. if (\\n[.$] < 3) \
-. Error .\\0: not enough arguments.
-. ds @pre \)\\$1\)\" prefix
-. ds @sep \)\\$2\)\" separator
-. ds @post \)\\$3\)\" postfix
-. shift 3
-. nr @count 0
-. ds @res address@hidden"
-. while (\\n[.$] >= 2) \{\
-. c do the pairs, break on no `-'
-. if !'\\$1'-' \{\
-. if !'\\$1'--' \
-. break
-. \}
-. c separator
-. if (address@hidden > 0) \
-. as @res address@hidden:\"
-. nr @count +1
-. c combine minus with option name
-. as @res \f[CB]\\-\"
-. if '\\$1'--' \
-. as @res \\-\"
-. as @res \\$2\"
-. shift 2
-. \}
-. if (\\n[.$] >= 3) \
-. Error .\\0: wrong arguments: \\$@
-. c all pairs are done
-. ie (\\n[.$] == 0) \
-. as @res address@hidden"
-. el \{\
-. c optional option argument
-. if !'\\$1'' \
-. as @res \f[CR] \,\f[I]\\$1\"
-. shift
-. c postfix
-. as @res address@hidden"
-. if (\\n[.$] >= 1) \{\
-. c add punctuation
-. as @res address@hidden"
-. \}
-. \}
-. nh
-. Text address@hidden
-. hy
-. ft address@hidden
-. rr @count
-. rr @font
-. rm @pre
-. rm @post
-. rm @sep
-. rm @res
-..
-.c --------------------------------------------------------------------
-.c .Text (<text>...)
-.c
-.c Treat the arguments as text, no matter how they look.
-.c
-.de Text
-. if (\\n[.$] == 0) \
-. return
-. nh
-. nop \)\\$*\)
-. hy
-..
-.c --------------------------------------------------------------------
-.c .File_name (<path_name>)
-.c
-.c Display a file or directory name in CB font.
-.c
-.de File_name
-. Header_CB \\$@
-..
-.c --------------------------------------------------------------------
-.c .Header_CB (<path_name>)
-.c
-.c Display a line in CB font, for example after .TP
-.c
-.de Header_CB
-. nh
-. Text \f[CB]\\$1\f[]\\$2
-. hy
-..
-.c --------------------------------------------------------------------
-.c .Topic ([<indent>])
-.c
-.c A bulleted paragraph
-.c
-.de Topic
-. ie (\\n[.$] = 0) \
-. ds @indent 2m\"
-. el \
-. ds @indent \\$1\"
-. TP address@hidden
-. Text \[bu]
-. rm @indent
-..
-.c --------------------------------------------------------------------
-.c .Shell_cmd (<CR> [<CI>] ...)
-.c
-.c A shell command line; display args alternating in fonts CR and CI.
-.c
-.de Shell_cmd
-. grog:Shell_cmd_base "\*[grog:Shell_cmd.prompt]" \\$@
+.\" Local macros
+.de FN
+.I \\$1
..
-.c --------------------------------------------------------------------
-.c .Shell_cmd_base (<prompt> [<CR> [<CI>] ...])
-.c
-.c A shell command line; display args alternating in fonts CR and CI.
-.c Internal, do not use directly.
-.c
-.c Globals: read-only register @.Shell_cmd_width
-.c
-.de grog:Shell_cmd_base
-. if (\\n[.$] <= 0) \
-. return
-. nr @+font \\n[.f]\"
-. ds @prompt \\$1\"
-. ft CR
-. c gap between prompt and command
-. nr @+gap \\n[grog:Shell_cmd_base.prompt_width]-\\w'address@hidden'\"
-. ds @res address@hidden'address@hidden'\"
-. shift
-. ds @cf CR\"
-. while (\\n[.$] > 0) \{\
-. as @res address@hidden"
-. shift
-. ie 'address@hidden'CR' \
-. ds @cf I\"
-. el \
-. ds @cf CR\"
-. \}
-. br
-. ad l
-. nh
-. nf
-. Text address@hidden"
-. fi
-. hy
-. ad
-. br
-. ft address@hidden
-. rr @+font
-. rr @+gap
-. rm @cf
-. rm @res
-..
-.
-.\" End of macro definitions
+
+.\" --------------------------------------------------------------------
.
+.SH NAME
+grog \- guess options for groff command
+
+.SH SYNOPSIS
.
.\" --------------------------------------------------------------------
.\" SH "SYNOPSIS"
.\" --------------------------------------------------------------------
.
-.ad l
-.Synopsis grog
-.RB [ \-C ]
-.RI [ groff\-option \*[Ellipsis]]
-.RB [ \-\- ]
-.RI [ \%filespec \*[Ellipsis]]
-./Synopsis
-.
-.Synopsis grog
-.Opt_alt - h -- help
-./Synopsis
-.
-.Synopsis grog
-.Opt_alt - v -- version
-./Synopsis
+.SY grog
+.OP \-C
+.OP groff\-option ...
+.OP \-\-
+.OP filespec ...
+.YS
+.
+.SY groff
+[
+.B -h
+|
+.B --help
+]
+.
+.SY groff
+[
+.B -v
+|
+--version
+]
+.YS
.
.
.\" --------------------------------------------------------------------
@@ -582,34 +320,33 @@
.SH "EXAMPLES"
.\" --------------------------------------------------------------------
.
-.Topic
+.IP \(bu
Calling
.RS
-.IP
-.Shell_cmd "grog meintro.me"
-.P
+.EX
+grog meintro.me
+.EE
results in
-.IP
-.ft CR
+.EX
groff \-me meintro.me
-.ft
+.EE
.P
So
.B grog
recognized that the file
-.File_name meintro.me
+.FN meintro.me
is written with the
.B \-me
macro package.
.RE
.
.
-.Topic
+.IP \(bu
On the other hand,
.RS
-.IP
-.Shell_cmd "grog pic.ms"
-.P
+.EX
+grog pic.ms
+.EE
outputs
.IP
.ft CR
@@ -620,7 +357,7 @@
.BR \-ms ,
.B grog
recognized that the file
-.File_name pic.ms
+.FN pic.ms
additionally needs
.BR \-pte ,
the combination of
@@ -637,12 +374,12 @@
.RE
.
.
-.Topic
+.IP \(bu
If both files are combined by the command
.RS
-.IP
-.Shell_cmd "grog meintro.me pic.ms"
-.P
+.EX
+grog meintro.me pic.ms
+.EE
an error message is sent to standard error because
.B groff
cannot work with two different macro packages:
@@ -662,12 +399,12 @@
.RE
.
.
-.Topic
+.IP \(bu
The call of
.RS
-.IP
-.Shell_cmd "grog \-ksS \-Tdvi grnexmpl.g"
-.P
+.EX
+grog \-ksS \-Tdvi grnexmpl.g
+.EE
contains several
.B groff
options that are just passed on the output without any interface to
@@ -684,11 +421,9 @@
with argument
.BR dvi .
The output is
-.IP
-.ft CR
+.EX
groff \-ksS \-Tdvi grnexmpl.g
-.ft
-.P
+.EE
so no additional option was added by
.BR grog .
As no option
@@ -699,7 +434,7 @@
.RE
.
.
-.Topic
+.IP \(bu
.B grog
can also handle files using the
.I chem
@@ -707,14 +442,13 @@
.
The example
.RS
-.IP
-.Shell_cmd "grog chAh_brackets.chem"
-.P
+.EX
+grog chAh_brackets.chem
+.EE
outputs
-.IP
-.ft CR
+.EX
chem chAh_brackets.chem | groff \-pe
-.ft
+.EE
.P
So
.B chem
@@ -757,7 +491,7 @@
.\" --------------------------------------------------------------------
.SH "COPYING"
.\" --------------------------------------------------------------------
-.copyleft
+.co
.
.
.\" --------------------------------------------------------------------
- [Groff-commit] groff/src/roff/grog grog.man,
Eric S. Raymond <=