diff options
author | jbj <jbj> | 2008-03-08 03:47:53 +0000 |
---|---|---|
committer | jbj <jbj> | 2008-03-08 03:47:53 +0000 |
commit | 04f0481b2d1156e28fff2a8039dac6befa6dacb5 (patch) | |
tree | 20da4d0de22ea683e1e2ddcac966c2589b8a9973 /popthelp.c | |
parent | ffea059a0fac440e81c45018531351983e84c287 (diff) | |
download | libpopt-04f0481b2d1156e28fff2a8039dac6befa6dacb5.tar.gz |
- jbj: make sure that short options are printed only once with --usage.
Diffstat (limited to 'popthelp.c')
-rw-r--r-- | popthelp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -845,8 +845,9 @@ static size_t showShortOptions(const struct poptOption * opt, FILE * fp, for (; (opt->longName || opt->shortName || opt->arg); opt++) { if (!F_ISSET(opt, DOC_HIDDEN) && opt->shortName && !poptArgType(opt)) { - /* Display shortName iff printable non-space. */ - if (isprint((int)opt->shortName) && opt->shortName != ' ') + /* Display shortName iff unique printable non-space. */ + if (!strchr(s, opt->shortName) && isprint((int)opt->shortName) + && opt->shortName != ' ') s[strlen(s)] = opt->shortName; } else if (poptArgType(opt) == POPT_ARG_INCLUDE_TABLE) if (opt->arg) /* XXX program error */ |