groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Several file arguments to groff


From: Ralph Corderoy
Subject: Re: [Groff] Several file arguments to groff
Date: Tue, 29 Oct 2002 21:06:56 +0000

Hi,

Hardware problems lead me to being late reading this thread, so I'll
reply to various points in one go.

Werner wrote:
> But the main reason is not groff but the function used to parse the
> command line arguments: GNU's getopt.  It sorts options and
> non-options (the latter coming first).

OT:  That's now my top GNU pet hate.  (It used to be the use of info
rather than man pages but I've now found `info --subnodes ... | less'
thanks to this list.)  I'm currently processing patches for a program
that, like strace, takes a command line as its arguments after any
options of its own, e.g.

    strace -e trace=open ls -l

With GNU getopt the user would have to use the clumsy

    strace -e trace=open -- ls -l

otherwise

    strace -e trace=open -l ls

is seen.

Unix just doesn't sort command line options, so why does GNU have to
choose otherwise?  And since the library doesn't seem to allow this to
be turned off, although I'm still looking, we have to re-invent our own
getopt, wasting their effort.

Larry Kollar wrote:
> Funny how things clump together like this: I was asking about this
> possibility a couple of weeks ago. What I'd like to see is a way to
> attach a clump of man pages to the end of a chapter without having to
> make two separate runs & assembling the output by hand.
> 
> ...
> 
> The hard part would be to preserve global settings like page layouts &
> so forth across a mass deletion like that. 

Given that you want page numbers, etc., to reflect the encompassing
document, would it be better to process the man page file separately,
producing EPS for each `page', and then pull each of those pages into
the parent document so they fit into the main text area?  That way,
they'd be clearly `included' rather than tacked on.

Depends what you want to achieve, but that would seem to be one way.

Bernd Warken wrote:
> > > Fixing is easy for `grog',
> > 
> > How shall grog be fixed?
>
> Writing a shell program that runs the awk grog for every file
> argument.

But the user of grog wants a command line printed that will process the
*documents* they've specified, e.g.

    $ grog ch1.tr ch2.tr
    groff -pt -mm ch1.tr ch2.tr

so

    groff -p -mm ch1.tr
    groff -pt -mm ch2.tr

would be the wrong output.  If that's what they really wanted then they
can do

    for f in ch[12].tr; do grog $f; done

> Right, the feature is not absolutely necessary.  But this should be
> documented.

Agreed absolutely that `groff -ms -mm -me foo.tr' having problems
should be explained to the user as it might be non-obvious.

> BTW grog is not an awk script as I wrote in a former mail, but a shell
> script.  Maybe grog should be limited to one filename or standard
> input.

No, see above.  BTW, I've attached the latest version of the grog.sh
I've been working on below.  The aim has been to move the logic from
code to data and add a -d debug option thaht will make it easier to
improve its heuristics.  All feedback welcome, especially if it gives
wrong or different results to the current groff one.

> +The
> +.B groff
> +program allows to specify several file names as arguments.
> +.
> +But this concept works only if all files use the same macro package.
> +.
> +If file arguments with different macro packages are used
> +.B groff
> +usually produces lots of errrors.

It's perfectly OK and useful for groff/troff to accept multiple -m
options.  Werner gives us the canonical example when he keeps reminding
us of -mtrace.

    groff -mtrace -mm tricky.tr

Cheers,


Ralph.


begin 755 grog.gz
M'XL("$3XOCT``V=R;V<`G5=M4]M&$/Y^OV*C:,`&address@hidden@0<PM0A+G:F
M36U"9.LLWT1OE61")B:_O7MW>CE9-C3U#.CNV=UG=^_V5J>G3Z`]84$[F1/R
M%-PX=*'5`G=!DP3"*&5AD,`LC+ED-H-IZ/MVX!BHVF.?*3CA-/T:46`!_$[C
address@hidden'[`[ZR!C;OL\"address@hidden"0'YK/6<X.0"+4"
MVZ>=3Q,[H7P$NOF)I)UVZD=M/1<;NDY($E*/^1WY6)D1##GI$(=.%F[')#1P
M?'O:T1JC<3J^VS>OEWI3(TG4T:6$$)Z:';O$"0G@;XK>0=,1T3`G`;5:3?'D
MOV3.9FDQF\34_ES,CHZD^JFB'G6*L0A,T_D#=;0-E#G)[;address@hidden'I
M/(3M\\OW<IL:8DN:D.F!95C/C?WM4OV.I6#6J%MSZD4EZ=1.X?BX2Q:)[=*7
M4"PUC++=-PSC&D8SYE$Q)%_F-*9%:address@hidden>+!.1`R&E,^Y/+QE
address@hidden"<>Y?45V2F;,(^E7\$/'2PC%DR]A</K)_+L*7^B`19<
MN$BC1<Z^`^CO*X0I1J<&AS[IC-U1!](0_=+"R@:>$H0S^-3:!I_:J)^D&+,=
M.\C.=0#8#()address@hidden/!/=QY;>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@NT]L09XP2SR#YL_4,address@hidden&#,CSQ&address@hidden
MMW&IU=,P]1UQMG-I;L0B?&$%HB,$#KUKA#SAY5AK5M2XWT(5NYM'`S>=-\0W
M0K,)address@hidden<##I:PXDXJ\O]AC3_CY'address@hidden(&D9O+DT9A*`H%7
M&%RQVP"[8I.![RVJ5Q.7#X0KJ&B,76)_^0SRRU-MTOSW>H"^->SHZN9=ON95
MO*^HR0CPPH9EL:UEG^<XV@/=:JYJ94I)M$%A-!YKUUQIC+^M%17=Y`')MM41
M!:E;O/".U..="?:address@hidden(D^X93Y\50YM8I*`N4AJWBHJQ7G+M,[6-&3
MB8X-GB7P#`^;-8[L4&4,AQL\,?6E(A8G47*UR#;\HJ<&;K!%Q#:W9I#-X;CM
MT-MVL/"\7&>?D`2_M64I\*MB^XE3C),0VDG[H[&CMXM/R3'9:J,+3?\-SPC1
@LTOCLNII7_VZS>H79SL:7CG](address@hidden'T,M(2````
`
end


reply via email to

[Prev in Thread] Current Thread [Next in Thread]