help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] convert ggo file to man page


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] convert ggo file to man page
Date: Thu, 17 Sep 2009 19:21:39 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Yegor Yefremov wrote:
Do you have any solution on how to format examples so that they look correct in 
both gengetopt help and man page? I'd like to have it in the following form:

1. if example and its description are short enough they should be placed on the 
same line with a tab between them
2. if example and its description are longer then place the description below 
and make some indentation as for the options.

Regards,
Yegor


Yegor, I tried with this reduced .ggo file (I modified it):

# Name of your program
package "hwtest" # don't use package if you're using automake
# Version of your program
version "1.2.1"   # don't use version if you're using automake

args "--conf-parser"

# Options
section "Common options"
        sectiondesc="this options are common to all test modules"
text ""
option "cfg"  -       "Configuration file"  string typestr="filename" optional
option "cycles"       - "Number of test cycles"     int default="0" optional
text "\n"
text "Examples:\n\n"

text "hwtest --cycles=1 --size=4096 --net --verbose\n\n"
text "execute network test with 4096 byte big test file in verbose mode\n"
text "\n"

text "hwtest --cycles=1 --mpci\n"
text "execute MiniPCI test\n"
text "\n"

and the first line of help is formatted correctly by help2man, since it contains a double \n (while the second one is not, since it contains only one \n):

EXAMPLES
       hwtest --cycles=1 --size=4096 --net --verbose

       execute network test with 4096 byte big test file in verbose mode

       hwtest --cycles=1 --mpci execute MiniPCI test

so it's just a matter of formatting the examples text as help2man expects, I guess...

or am I missing something?

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net




reply via email to

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