Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop showing '=' for short options #44

Merged
merged 2 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
.ccache
.deps
.deps/
.depend
.libs
.libs/
ABOUT-NLS
ChangeLog
Doxyfile
Makefile
Makefile.in
aclocal.m4
autom4te*
/aclocal.m4
/autom4te*
build
clang
config.cache
config.guess
config.h
config.h.in
config.log
config.rpath
config.status
config.sub
configure
/config.*
/configure
doxygen
depcomp
install-sh
intl
lconv
libtool
ltconfig
ltmain.sh
m4
missing
mkinstalldirs
/m4/
popt.spec
stamp-h
stamp-h1
stamp-h.in
tdict
test-poptrc
test1
test2
test3
/tests/test-suite.log
/tests/testit.sh.log
/tests/testit.sh.trs
/tests/test1
/tests/test2
/tests/test3
*.gcda
*.gcno
*.gmo
*.la
*.lcd
*.lo
*.swp
*.o
popt.pc
popt-*.tar.gz

/build-aux/
/po/Makefile.in.in
/po/Makevars.template
/po/POTFILES
/po/Rules-quot
/po/boldquot.sed
/po/en@boldquot.header
/po/en@quot.header
/po/insert-header.sin
/po/quot.sed
/po/remove-potcdate.sin
/po/stamp-po
5 changes: 3 additions & 2 deletions src/popthelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ static void singleOptionHelp(FILE * fp, columns_t columns,
/* XXX argDescrip[0] determines "--foo=bar" or "--foo bar". */
if (!strchr(" =(", argDescrip[0]))
*le++ = ((poptArgType(opt) == POPT_ARG_MAINCALL) ? ' ' :
(poptArgType(opt) == POPT_ARG_ARGV) ? ' ' : '=');
(poptArgType(opt) == POPT_ARG_ARGV) ? ' ' :
opt->longName == NULL ? ' ' : '=');
le = stpcpy(leo = le, argDescrip);

/* Adjust for (possible) wide characters. */
Expand Down Expand Up @@ -700,7 +701,7 @@ static size_t singleOptionUsage(FILE * fp, columns_t columns,

if (argDescrip) {
/* XXX argDescrip[0] determines "--foo=bar" or "--foo bar". */
if (!strchr(" =(", argDescrip[0])) fprintf(fp, "=");
if (!strchr(" =(", argDescrip[0])) fputc(opt->longName == NULL ? ' ' : '=', fp);
fprintf(fp, "%s", argDescrip);
}
fprintf(fp, "]");
Expand Down