diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-03-27 23:53:50 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-03-27 23:53:50 -0400 |
commit | d81fc0710ae12ce026053163370ab3dac5c1b1a5 (patch) | |
tree | b1b911eb493bb6f8f5356a3d3d0562288a1a4efb /main.c | |
parent | qlop: add --date option to filter output (diff) | |
download | portage-utils-d81fc0710ae12ce026053163370ab3dac5c1b1a5.tar.gz portage-utils-d81fc0710ae12ce026053163370ab3dac5c1b1a5.tar.bz2 portage-utils-d81fc0710ae12ce026053163370ab3dac5c1b1a5.zip |
usage: add an extended text sectionv0.63
Many applets now are so complicated that a single line of text isn't
sufficient to describe all of its capabilities/nuances. Allow them
to pass in an arbitrary string of data to contain examples.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -115,7 +115,7 @@ void no_colors(void) /* display usage and exit */ static void usage(int status, const char *flags, struct option const opts[], - const char * const help[], int blabber) + const char * const help[], const char *desc, int blabber) { const char opt_arg[] = "[arg]"; const char a_arg[] = "<arg>"; @@ -136,10 +136,13 @@ static void usage(int status, const char *flags, struct option const opts[], DKBLUE, applets[i].opts, NORM, RED, NORM, _(applets[i].desc)); } else if (blabber > 0) { - printf("%sUsage:%s %s%s%s <opts> %s%s%s %s:%s %s\n", GREEN, NORM, - YELLOW, applets[blabber].name, NORM, - DKBLUE, applets[blabber].opts, NORM, - RED, NORM, _(applets[blabber].desc)); + printf("%sUsage:%s %s%s%s [opts] %s%s%s %s:%s %s\n", + GREEN, NORM, + YELLOW, applets[blabber].name, NORM, + DKBLUE, applets[blabber].opts, NORM, + RED, NORM, _(applets[blabber].desc)); + if (desc) + printf("\n%s\n", desc); } if (module_name != NULL) printf("%sLoaded module:%s\n%s%8s%s %s<args>%s\n", GREEN, NORM, YELLOW, module_name, NORM, DKBLUE, NORM); |