RPM Community Forums

Mailing List Message of <popt-devel>

Re: How popt auto doc process text with newline fine?

From: Jeffrey Johnson <n3npq@me.com>
Date: Tue 25 Dec 2012 - 04:53:35 CET
Message-id: <E4921189-DF5A-4158-97E4-5589CA6ACEB3@me.com>

On Dec 24, 2012, at 8:34 PM, zzs <zzs213@126.com> wrote:

> Auto document in popt is very good.
> 
> But when I want the document of a option have serval paragraphs
> It output bad things.
> 
> My option define like this:
> 	{
> 	.longName   = "fre",
> 	.shortName  = '\0',
> 	.descrip    = " RF output fre in Hz e.g. \n"
> 	              " (1) 1000100000 1000.1M 1000100K. \n"
> 	              " (2) ++ plus a PhaseFrequencyDetect fre. \n"
> 	              " (3) +  plus a step. \n"
> 	              " (4) -- minus a PhaseFrequencyDetect fre. \n"
> 	              " (5) -  minus a step",
> 	.argDescrip = "fre",
> 	.argInfo    = POPT_ARG_STRING,
> 	.arg        = &fre,
> 	.val        = 0
> 	},
> 
> I want popt output the help string like it defined. e.g.
> When a newline char appears, It should start a new paragraph.
> But Popt looks like dosn't get special process for new line char.
> 

(aside)
What version of popt?

You are likely correct that popt doesn't deal with
'\n' characters correctly (i.e by appending blanks to
space out to what you wish as a "paragraph", i.e. an
aligned text block).

The killer issue is wide characters, which popt nearly
-- but not quite -- handles correctly.

No reliable spacing is possible until wide characters
(and i18n) are handled correctly.

There are serious portability issues -- both platform
and legacy compatibility -- issues involved with handling
wide characters and i18n.

Sadly, I permitted a GNOME patch 5+ years ago from a JA
developer that has made a huge mess in popt. The patch
tries to do iconv(3) conversions "the hard way" (i.e.
without using the GNU specific iconv library).

Again: without solid/reliable spacing, "paragraph" (or
block of text indentation) simply isn't feasible.

And unless someone assists with the character encoding
testing positively (not just complaining because text
doesn't align), well … what you are asking for simply
isn't ever going to happen (because the patch would
have been sent years ago) in FL/OSS development.

73 de Jeff
Received on Tue Dec 25 06:55:21 2012
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.