help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] gengetopt: bug found in gm.cc:584


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] gengetopt: bug found in gm.cc:584
Date: Wed, 13 Sep 2006 11:57:09 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

Ch'Gans wrote:
Hi all,

I found a bug when using --long-help, I have used genpetopt 2.17
(manually installed on a mandriva 10.1), with and without my last patch,
and the gengetopt shipped with my distro (2.12.2). All these version
lead to the bug.

you're right, again! :-)

here's a quick patch (I've tested and it seems to work, but I'll perform more tests). This is against the version I'm working on, so the lines might be different from the one in version 2.17, but you should be able to correct the problem with this patch.

hope to hear from you soon

cheers
        Lorenzo

diff -c -r1.107 gm.cc
*** gm.cc       4 Sep 2006 06:39:43 -0000       1.107
--- gm.cc       13 Sep 2006 09:53:11 -0000
***************
*** 557,562 ****
--- 557,572 ----
        foropt
          if (opt->required && !opt->hidden) /* required options */
            switch (opt->type) {
+           case ARG_NO:
+           case ARG_FLAG:
+             usage << "[";
+             if (opt->short_opt)
+               {
+                 usage << "-" << opt->short_opt << "|";
+               }
+             usage << "--" << opt->long_opt << "] ";
+             break;
+
            case ARG_INT:
            case ARG_SHORT:
            case ARG_LONG:


--
+-----------------------------------------------------+
|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        : http://www.lorenzobettini.it    |
|  http://music.dsi.unifi.it         XKlaim language  |
|  http://www.purplesucker.com Deep Purple Cover Band |
|  http://www.gnu.org/software/src-highlite           |
|  http://www.gnu.org/software/gengetopt              |
|  http://www.lorenzobettini.it/software/gengen       |
|  http://www.lorenzobettini.it/software/doublecpp    |
+-----------------------------------------------------+




reply via email to

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