Commit 2a28ab58 2a28ab58762f9ae9cd00ca3e467ee6f90f241201 by Sergey Poznyakoff

Rewrite parseopt help routines using wordwrap streams

* include/mailutils/stream.h (MU_IOCTL_WORDWRAP_SET_NEXT_MARGIN)
(MU_IOCTL_WORDWRAP_GET_OFFSET): New opcodes.
* libmailutils/stream/wordwrap.c (_wordwrap_flush_line): Replace
whitespace-only lines with single newline on output.
(_wordwrap_flush): Fix condition.
(set_margin): Bugfix.
(_wordwrap_ctl): Handle new opcodes.

* include/mailutils/cli.h (mu_version_func): Change signature.
* include/mailutils/opt.h (mu_parseopt) <po_help_hook>
<po_version_hook>: Change signature.
(mu_parseopt_fmt_text): Remove.
(mu_option_describe_options, mu_program_help)
(mu_program_usage): Change signature.
(mu_program_version): New prototype.
* libmailutils/cli/cli.c (mu_version_func): Take mu_stream_t as
2nd argument.  Use mu_stream_printf for output.
(extra_help_hook): Likewise.
* libmailutils/opt/help.c: Rewrite using wordwrap streams.
* libmailutils/opt/opt.c (fn_help, fn_usage, fn_version): Update.
* libmailutils/tests/parseopt.c (version_hook): Write to mu_stream_t.

* libmailutils/tests/parseopt_help00.at: Fix expected output.
* libmailutils/tests/parseopt_help01.at: Likewise.
* libmailutils/tests/parseopt_help02.at: Likewise.
* libmailutils/tests/parseopt_help03.at: Likewise.
* libmailutils/tests/parseopt_help04.at: Likewise.
* libmailutils/tests/parseopt_help05.at: Likewise.
* libmailutils/tests/parseopt_help06.at: Likewise.
* libmailutils/tests/parseopt_help07.at: Likewise.
* libmailutils/tests/parseopt_help08.at: Likewise.
* libmailutils/tests/parseopt_help09.at: Likewise.
* libmailutils/tests/parseopt_help10.at: Likewise.
* libmailutils/tests/parseopt_help11.at: Likewise.
1 parent 06c13b34
......@@ -50,7 +50,7 @@ struct mu_cli_setup
errors */
};
void mu_version_func (struct mu_parseopt *po, FILE *stream);
void mu_version_func (struct mu_parseopt *po, mu_stream_t stream);
void mu_cli (int argc, char **argv, struct mu_cli_setup *setup,
char **capa, void *data,
int *ret_argc, char ***ret_argv);
......
......@@ -131,9 +131,8 @@ struct mu_parseopt
char const *po_package_url;
char const *po_extra_info;
/* FIXME: should these take mu_stream_t ?*/
void (*po_help_hook) (struct mu_parseopt *po, FILE *stream);
void (*po_version_hook) (struct mu_parseopt *po, FILE *stream);
void (*po_help_hook) (struct mu_parseopt *po, mu_stream_t stream);
void (*po_version_hook) (struct mu_parseopt *po, mu_stream_t stream);
/* Output data */
int po_ind; /* Index of the next option */
......@@ -169,11 +168,12 @@ int mu_parseopt_apply (struct mu_parseopt *p);
void mu_parseopt_free (struct mu_parseopt *p);
unsigned mu_parseopt_getcolumn (const char *name);
void mu_parseopt_fmt_text (const char *text, size_t col);
void mu_option_describe_options (struct mu_option **optbuf, size_t optcnt);
void mu_program_help (struct mu_parseopt *p);
void mu_program_usage (struct mu_parseopt *p);
void mu_option_describe_options (mu_stream_t str,
struct mu_option **optbuf, size_t optcnt);
void mu_program_help (struct mu_parseopt *p, mu_stream_t str);
void mu_program_usage (struct mu_parseopt *p, mu_stream_t str);
void mu_program_version (struct mu_parseopt *po, mu_stream_t str);
void mu_option_set_value (struct mu_parseopt *po, struct mu_option *opt,
char const *arg);
......
......@@ -211,6 +211,8 @@ enum mu_buffer_type
#define MU_IOCTL_WORDWRAP_GET_MARGIN 0
#define MU_IOCTL_WORDWRAP_SET_MARGIN 1
#define MU_IOCTL_WORDWRAP_MOVE_MARGIN 2
#define MU_IOCTL_WORDWRAP_SET_NEXT_MARGIN 3
#define MU_IOCTL_WORDWRAP_GET_OFFSET 4
struct mu_nullstream_pattern
{
......
......@@ -53,40 +53,37 @@ const char mu_version_copyright[] =
"Copyright %s 2007-2016 Free Software Foundation, inc.";
void
mu_version_func (struct mu_parseopt *po, FILE *stream)
mu_version_func (struct mu_parseopt *po, mu_stream_t stream)
{
#ifdef GIT_DESCRIBE
fprintf (stream, "%s (%s) %s [%s]\n",
mu_program_name, PACKAGE_NAME, PACKAGE_VERSION, GIT_DESCRIBE);
mu_stream_printf (stream, "%s (%s) %s [%s]\n",
mu_program_name, PACKAGE_NAME, PACKAGE_VERSION,
GIT_DESCRIBE);
#else
fprintf (stream, "%s (%s) %s\n", mu_program_name,
mu_stream_printf (stream, "%s (%s) %s\n", mu_program_name,
PACKAGE_NAME, PACKAGE_VERSION);
#endif
/* TRANSLATORS: Translate "(C)" to the copyright symbol
(C-in-a-circle), if this symbol is available in the user's
locale. Otherwise, do not translate "(C)"; leave it as-is. */
fprintf (stream, mu_version_copyright, _("(C)"));
fputs (_("\
mu_stream_printf (stream, mu_version_copyright, _("(C)"));
mu_stream_printf (stream, _("\
\n\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\n\
There is NO WARRANTY, to the extent permitted by law.\n\
\n\
"),
stream);
"));
}
static char gnu_general_help_url[] =
N_("General help using GNU software: <http://www.gnu.org/gethelp/>");
static void
extra_help_hook (struct mu_parseopt *po, FILE *stream)
extra_help_hook (struct mu_parseopt *po, mu_stream_t stream)
{
struct mu_cfg_parse_hints *hints = po->po_data;
struct mu_cli_setup *setup = hints->data;
char *extra_doc = _(setup->prog_extra_doc);
/* FIXME: mu_parseopt help output should get FILE * argument */
mu_parseopt_fmt_text (extra_doc, 0);
fputc ('\n', stdout);
mu_stream_printf (stream, "%s\n", _(setup->prog_extra_doc));
}
static void
......
......@@ -27,6 +27,7 @@
#include <mailutils/cctype.h>
#include <mailutils/nls.h>
#include <mailutils/wordsplit.h>
#include <mailutils/stream.h>
unsigned short_opt_col = 2;
unsigned long_opt_col = 6;
......@@ -185,90 +186,68 @@ init_usage_vars (struct mu_parseopt *po)
mu_wordsplit_free (&ws);
}
static int
indent (int start, int col)
static void
set_margin (mu_stream_t str, unsigned margin)
{
for (; start < col; start++)
putchar (' ');
return start;
mu_stream_ioctl (str, MU_IOCTL_WORDWRAPSTREAM,
MU_IOCTL_WORDWRAP_SET_MARGIN,
&margin);
}
static void
print_option_descr (const char *descr, size_t lmargin, size_t rmargin)
set_next_margin (mu_stream_t str, unsigned margin)
{
while (*descr)
{
size_t s = 0;
size_t i;
size_t width = rmargin - lmargin;
for (i = 0; ; i++)
{
if (descr[i] == 0 || descr[i] == ' ' || descr[i] == '\t')
{
if (i > width)
break;
s = i;
if (descr[i] == 0)
break;
}
else if (descr[i] == '\n')
{
s = i;
break;
}
}
fwrite (descr, 1, s, stdout);
fputc ('\n', stdout);
descr += s;
if (*descr)
{
indent (0, lmargin);
descr++;
}
}
mu_stream_ioctl (str, MU_IOCTL_WORDWRAPSTREAM,
MU_IOCTL_WORDWRAP_SET_NEXT_MARGIN,
&margin);
}
void
mu_parseopt_fmt_text (const char *text, size_t col)
static void
get_offset (mu_stream_t str, unsigned *offset)
{
print_option_descr (text, col, rmargin);
mu_stream_ioctl (str, MU_IOCTL_WORDWRAPSTREAM,
MU_IOCTL_WORDWRAP_GET_OFFSET,
offset);
}
static void
move_margin (mu_stream_t str, int margin)
{
mu_stream_ioctl (str, MU_IOCTL_WORDWRAPSTREAM,
MU_IOCTL_WORDWRAP_MOVE_MARGIN,
&margin);
}
static size_t
print_opt_arg (struct mu_option *opt, int delim)
static void
print_opt_arg (mu_stream_t str, struct mu_option *opt, int delim)
{
int w = 0;
if (opt->opt_flags & MU_OPTION_ARG_OPTIONAL)
{
if (delim == '=')
w = printf ("[=%s]", gettext (opt->opt_arg));
mu_stream_printf (str, "[=%s]", gettext (opt->opt_arg));
else
w = printf ("[%s]", gettext (opt->opt_arg));
mu_stream_printf (str, "[%s]", gettext (opt->opt_arg));
}
else
w = printf ("%c%s", delim, gettext (opt->opt_arg));
return w;
mu_stream_printf (str, "%c%s", delim, gettext (opt->opt_arg));
}
static size_t
print_option (struct mu_option **optbuf, size_t optcnt, size_t num,
print_option (mu_stream_t str,
struct mu_option **optbuf, size_t optcnt, size_t num,
int *argsused)
{
struct mu_option *opt = optbuf[num];
size_t next, i;
int delim;
int w;
int first_option = 1;
int first_long_option = 1;
if (MU_OPTION_IS_GROUP_HEADER (opt))
{
if (num)
putchar ('\n');
mu_stream_printf (str, "\n");
if (opt->opt_doc[0])
{
indent (0, header_col);
print_option_descr (gettext (opt->opt_doc), header_col, rmargin);
set_margin (str, header_col);
mu_stream_printf (str, "%s", gettext (opt->opt_doc));
}
return num + 1;
}
......@@ -281,22 +260,19 @@ print_option (struct mu_option **optbuf, size_t optcnt, size_t num,
if (opt->opt_flags & MU_OPTION_HIDDEN)
return next;
w = 0;
set_margin (str, short_opt_col);
for (i = num; i < next; i++)
{
if (MU_OPTION_IS_VALID_SHORT_OPTION (optbuf[i]))
{
if (w == 0)
{
indent (0, short_opt_col);
w = short_opt_col;
}
if (first_option)
first_option = 0;
else
w += printf (", ");
w += printf ("-%c", optbuf[i]->opt_short);
mu_stream_printf (str, ", ");
mu_stream_printf (str, "-%c", optbuf[i]->opt_short);
delim = ' ';
if (opt->opt_arg && dup_args)
w += print_opt_arg (opt, delim);
print_opt_arg (str, opt, delim);
}
}
......@@ -304,19 +280,24 @@ print_option (struct mu_option **optbuf, size_t optcnt, size_t num,
{
if (MU_OPTION_IS_VALID_LONG_OPTION (optbuf[i]))
{
if (w == 0)
if (first_option)
first_option = 0;
else
mu_stream_printf (str, ", ");
if (first_long_option)
{
indent (0, short_opt_col);
w = short_opt_col;
unsigned off;
get_offset (str, &off);
if (off < long_opt_col)
set_margin (str, long_opt_col);
first_long_option = 0;
}
else
w += printf (", ");
if (i == num)
w = indent (w, long_opt_col);
w += printf ("--%s", optbuf[i]->opt_long);
mu_stream_printf (str, "--%s", optbuf[i]->opt_long);
delim = '=';
if (opt->opt_arg && dup_args)
w += print_opt_arg (opt, delim);
print_opt_arg (str, opt, delim);
}
}
......@@ -324,70 +305,87 @@ print_option (struct mu_option **optbuf, size_t optcnt, size_t num,
{
*argsused = 1;
if (!dup_args)
w += print_opt_arg (opt, delim);
}
if (w >= opt_doc_col)
{
putchar ('\n');
w = 0;
print_opt_arg (str, opt, delim);
}
indent (w, opt_doc_col);
print_option_descr (gettext (opt->opt_doc), opt_doc_col, rmargin);
set_margin (str, opt_doc_col);
mu_stream_printf (str, "%s\n", gettext (opt->opt_doc));
return next;
}
void
mu_option_describe_options (struct mu_option **optbuf, size_t optcnt)
mu_option_describe_options (mu_stream_t str,
struct mu_option **optbuf, size_t optcnt)
{
unsigned i;
int argsused = 0;
for (i = 0; i < optcnt; )
i = print_option (optbuf, optcnt, i, &argsused);
putchar ('\n');
i = print_option (str, optbuf, optcnt, i, &argsused);
mu_stream_printf (str, "\n");
if (argsused && dup_args_note)
{
print_option_descr (_("Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options."), 0, rmargin);
putchar ('\n');
set_margin (str, 0);
mu_stream_printf (str, "%s\n\n",
_("Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options."));
}
}
void
mu_program_help (struct mu_parseopt *po)
mu_program_help (struct mu_parseopt *po, mu_stream_t outstr)
{
mu_stream_t str;
int rc;
init_usage_vars (po);
printf ("%s", _("Usage:"));
rc = mu_wordwrap_stream_create (&str, outstr, 0, rmargin);
if (rc)
{
abort ();//FIXME
}
mu_stream_printf (str, "%s", _("Usage:"));
if (po->po_prog_name)
printf (" %s", po->po_prog_name);
printf (" [%s]...", _("OPTION"));
mu_stream_printf (str, " %s ", po->po_prog_name);
move_margin (str, 0);
mu_stream_printf (str, "[%s]...", _("OPTION"));
if (po->po_prog_args)
printf (" %s", gettext (po->po_prog_args));
putchar ('\n');
mu_stream_printf (str, " %s", gettext (po->po_prog_args));
mu_stream_printf (str, "\n");
if (po->po_prog_doc)
print_option_descr (gettext (po->po_prog_doc), 0, rmargin);
putchar ('\n');
{
set_margin (str, 0);
mu_stream_printf (str, "%s\n", gettext (po->po_prog_doc));
}
mu_stream_printf (str, "\n");
mu_option_describe_options (po->po_optv, po->po_optc);
mu_option_describe_options (str, po->po_optv, po->po_optc);
if (po->po_help_hook)
po->po_help_hook (po, stdout);
{
po->po_help_hook (po, str);
mu_stream_printf (str, "\n");
}
set_margin (str, 0);
if (po->po_bug_address)
/* TRANSLATORS: The placeholder indicates the bug-reporting address
for this package. Please add _another line_ saying
"Report translation bugs to <...>\n" with the address for translation
bugs (typically your translation team's web or email address). */
printf (_("Report bugs to <%s>.\n"), po->po_bug_address);
mu_stream_printf (str, _("Report bugs to <%s>.\n"), po->po_bug_address);
if (po->po_package_name && po->po_package_url)
printf (_("%s home page: <%s>\n"),
mu_stream_printf (str, _("%s home page: <%s>\n"),
po->po_package_name, po->po_package_url);
if (po->po_flags & MU_PARSEOPT_EXTRA_INFO)
print_option_descr (_(po->po_extra_info), 0, rmargin);
mu_stream_printf (str, "%s\n", _(po->po_extra_info));
mu_stream_destroy (&str);
}
static struct mu_option **option_tab;
......@@ -426,41 +424,32 @@ cmpidx_long (const void *a, const void *b)
}
void
mu_program_usage (struct mu_parseopt *po)
mu_program_usage (struct mu_parseopt *po, mu_stream_t outstr)
{
int rc;
unsigned i;
unsigned n;
char buf[rmargin+1];
unsigned *idxbuf;
unsigned nidx;
struct mu_option **optbuf = po->po_optv;
size_t optcnt = po->po_optc;
#define FLUSH \
do \
{ \
buf[n] = 0; \
printf ("%s\n", buf); \
n = usage_indent; \
if (n) memset (buf, ' ', n); \
} \
while (0)
#define ADDC(c) \
do \
{ \
if (n == rmargin) FLUSH; \
buf[n++] = c; \
} \
while (0)
mu_stream_t str;
init_usage_vars (po);
rc = mu_wordwrap_stream_create (&str, outstr, 0, rmargin);
if (rc)
{
abort ();//FIXME
}
option_tab = optbuf;
idxbuf = mu_calloc (optcnt, sizeof (idxbuf[0]));
n = snprintf (buf, sizeof buf, "%s %s ", _("Usage:"), po->po_prog_name);
mu_stream_printf (str, "%s %s ", _("Usage:"), po->po_prog_name);
set_next_margin (str, usage_indent);
/* Print a list of short options without arguments. */
for (i = nidx = 0; i < optcnt; i++)
......@@ -470,14 +459,12 @@ mu_program_usage (struct mu_parseopt *po)
if (nidx)
{
qsort (idxbuf, nidx, sizeof (idxbuf[0]), cmpidx_short);
ADDC ('[');
ADDC ('-');
mu_stream_printf (str, "[-");
for (i = 0; i < nidx; i++)
{
ADDC (optbuf[idxbuf[i]]->opt_short);
mu_stream_printf (str, "%c", optbuf[idxbuf[i]]->opt_short);
}
ADDC (']');
mu_stream_printf (str, "%c", ']');
}
/* Print a list of short options with arguments. */
......@@ -495,19 +482,10 @@ mu_program_usage (struct mu_parseopt *po)
{
struct mu_option *opt = optbuf[idxbuf[i]];
const char *arg = gettext (opt->opt_arg);
size_t len = 5 + strlen (arg) + 1;
if (n + len >= rmargin)
FLUSH;
if (opt->opt_flags & MU_OPTION_ARG_OPTIONAL)
mu_stream_printf (str, " [-%c[%s]]", opt->opt_short, arg);
else
buf[n++] = ' ';
buf[n++] = '[';
buf[n++] = '-';
buf[n++] = opt->opt_short;
buf[n++] = ' ';
strcpy (&buf[n], arg);
n += strlen (arg);
buf[n++] = ']';
mu_stream_printf (str, " [-%c %s]", opt->opt_short, arg);
}
}
......@@ -526,52 +504,41 @@ mu_program_usage (struct mu_parseopt *po)
{
struct mu_option *opt = optbuf[idxbuf[i]];
const char *arg = opt->opt_arg ? gettext (opt->opt_arg) : NULL;
size_t len = 5 + strlen (opt->opt_long)
+ (arg ? 1 + strlen (arg) : 0);
if (n + len >= rmargin)
FLUSH;
else
buf[n++] = ' ';
buf[n++] = '[';
buf[n++] = '-';
buf[n++] = '-';
strcpy (&buf[n], opt->opt_long);
n += strlen (opt->opt_long);
mu_stream_printf (str, " [--%s", opt->opt_long);
if (opt->opt_arg)
{
buf[n++] = '=';
strcpy (&buf[n], arg);
n += strlen (arg);
if (opt->opt_flags & MU_OPTION_ARG_OPTIONAL)
mu_stream_printf (str, "[=%s]", arg);
else
mu_stream_printf (str, "=%s", arg);
}
buf[n++] = ']';
mu_stream_printf (str, "%c", ']');
}
}
if (po->po_flags & MU_PARSEOPT_PROG_ARGS)
{
char const *p = po->po_prog_args;
mu_stream_printf (str, " %s", _(po->po_prog_args));
if (n + 1 >= rmargin)
FLUSH;
buf[n++] = ' ';
mu_stream_destroy (&str);
while (*p)
{
size_t len = strcspn (p, " \t\n");
if (len == 0)
len = 1;
if (n + len >= rmargin)
FLUSH;
else
free (idxbuf);
}
void
mu_program_version (struct mu_parseopt *po, mu_stream_t outstr)
{
int rc;
mu_stream_t str;
init_usage_vars (po);
rc = mu_wordwrap_stream_create (&str, outstr, 0, rmargin);
if (rc)
{
memcpy (buf + n, p, len);
p += len;
n += len;
}
}
abort ();//FIXME
}
po->po_version_hook (po, str);
FLUSH;
free (idxbuf);
mu_stream_destroy (&str);
}
......
......@@ -24,6 +24,7 @@
#include <mailutils/opt.h>
#include <mailutils/nls.h>
#include <mailutils/errno.h>
#include <mailutils/stdstream.h>
#define EXIT_SUCCESS 0
#define EXIT_ERROR 1
......@@ -78,7 +79,7 @@ sort_group (struct mu_option **optbuf, size_t start)
static void
fn_help (struct mu_parseopt *po, struct mu_option *opt, char const *unused)
{
mu_program_help (po);
mu_program_help (po, mu_strout);
exit (EXIT_SUCCESS);
}
......@@ -86,14 +87,14 @@ fn_help (struct mu_parseopt *po, struct mu_option *opt, char const *unused)
static void
fn_usage (struct mu_parseopt *po, struct mu_option *opt, char const *unused)
{
mu_program_usage (po);
mu_program_usage (po, mu_strout);
exit (EXIT_SUCCESS);
}
static void
fn_version (struct mu_parseopt *po, struct mu_option *opt, char const *unused)
{
po->po_version_hook (po, stdout);
mu_program_version (po, mu_strout);
exit (EXIT_SUCCESS);
}
......
......@@ -88,7 +88,7 @@ _wordwrap_flush_line (struct mu_wordwrap_stream *str, int lookahead)
}
}
while (length > 0 && mu_isblank (str->buffer[length - 1]))
while (length > 0 && mu_isspace (str->buffer[length - 1]))
length--;
if (length == 0 || str->buffer[length - 1] != '\n')
......@@ -147,7 +147,7 @@ static int
_wordwrap_flush (mu_stream_t stream)
{
struct mu_wordwrap_stream *str = (struct mu_wordwrap_stream *)stream;
if (str->offset)
if (str->offset > str->left_margin)
_wordwrap_flush_line (str, 0);
return mu_stream_flush (str->transport);
}
......@@ -177,18 +177,19 @@ set_margin (mu_stream_t stream, unsigned lmargin, int off)
if (lmargin >= str->right_margin)
return EINVAL;
if (lmargin < str->offset)
{
str->left_margin = lmargin;
if (lmargin < str->offset ||
(str->offset > 0 && str->buffer[str->offset - 1] == '\n'))
{
_wordwrap_flush (stream);
}
else if (lmargin > str->offset)
{
memset (str->buffer + str->offset, ' ',
lmargin - str->offset);
str->left_margin = lmargin;
memset (str->buffer + str->offset, ' ', lmargin - str->offset);
str->offset = lmargin;
}
return 0;
}
......@@ -217,12 +218,30 @@ _wordwrap_ctl (mu_stream_t stream, int code, int opcode, void *arg)
else
return set_margin (stream, *(unsigned*)arg, 0);
case MU_IOCTL_WORDWRAP_SET_NEXT_MARGIN:
if (!arg)
return EINVAL;
else
{
unsigned marg = *(unsigned*)arg;
if (marg >= str->right_margin)
return EINVAL;
str->left_margin = marg;
}
break;
case MU_IOCTL_WORDWRAP_MOVE_MARGIN:
if (!arg)
return EINVAL;
else
return set_margin (stream, str->offset, *(int*)arg);
case MU_IOCTL_WORDWRAP_GET_OFFSET:
if (!arg)
return EINVAL;
*(unsigned*)arg = str->offset;
break;
default:
return EINVAL;
}
......
......@@ -64,9 +64,9 @@ struct mu_option group_b[] = {
struct mu_option *optv[] = { group_a, group_b, NULL };
static void
version_hook (struct mu_parseopt *po, FILE *fp)
version_hook (struct mu_parseopt *po, mu_stream_t str)
{
fputs ("version hook called\n", fp);
mu_stream_printf (str, "version hook called\n");
}
#define S(s) ((s)?(s):"(null)")
......
......@@ -30,8 +30,8 @@ parseopt --help
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -21,8 +21,8 @@ PARSEOPT_DEFAULT
parseopt --usage
],
[0],
[[Usage: parseopt [-advx?] [-f FILE] [-F VALUE] [-j N] [-o FILE] [--all]
[[Usage: parseopt [-advx?] [-f FILE] [-F VALUE] [-j N] [-o[FILE]] [--all]
[--debug] [--file=FILE] [--find=VALUE] [--help] [--jobs=N]
[--optional=FILE] [--usage] [--verbose]
[--optional[=FILE]] [--usage] [--verbose]
]])
AT_CLEANUP
......
......@@ -30,8 +30,8 @@ MU_PARSEOPT_PROG_NAME=newname parseopt --help
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -31,8 +31,8 @@ Tests option parsing
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -30,8 +30,8 @@ MU_PARSEOPT_PROG_ARGS="SOME MORE ARGS" parseopt --help
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -30,8 +30,8 @@ MU_PARSEOPT_BUG_ADDRESS='gray@gnu.org' parseopt --help
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -30,8 +30,8 @@ MU_PARSEOPT_PACKAGE_NAME='GNU Mailutils' MU_PARSEOPT_PACKAGE_URL='http://mailuti
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -37,8 +37,8 @@ Tests option parsing
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -31,8 +31,8 @@ ARGP_HELP_FMT=dup-args,no-dup-args-note,short-opt-col=1,opt-doc-col=32,header-co
-x short-only option
Group B
-F VALUE, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F VALUE, --find=VALUE find VALUE
-j N, --jobs=N sets numeric value
-?, --help give this help list
......
......@@ -23,7 +23,7 @@ ARGP_HELP_FMT=rmargin=62,usage-indent=1\
],
[0],
[[Usage: parseopt [-advx?] [-f FILE] [-F VALUE] [-j N]
[-o FILE] [--all] [--debug] [--file=FILE] [--find=VALUE]
[--help] [--jobs=N] [--optional=FILE] [--usage] [--verbose]
[-o[FILE]] [--all] [--debug] [--file=FILE] [--find=VALUE]
[--help] [--jobs=N] [--optional[=FILE]] [--usage] [--verbose]
]])
AT_CLEANUP
......
......@@ -21,8 +21,8 @@ PARSEOPT_DEFAULT
MU_PARSEOPT_VERSION_HOOK=1 parseopt --usage
],
[0],
[[Usage: parseopt [-advVx?] [-f FILE] [-F VALUE] [-j N] [-o FILE] [--all]
[[Usage: parseopt [-advVx?] [-f FILE] [-F VALUE] [-j N] [-o[FILE]] [--all]
[--debug] [--file=FILE] [--find=VALUE] [--help] [--jobs=N]
[--optional=FILE] [--usage] [--verbose] [--version]
[--optional[=FILE]] [--usage] [--verbose] [--version]
]])
AT_CLEANUP
......
......@@ -30,8 +30,8 @@ MU_PARSEOPT_VERSION_HOOK=1 parseopt --help
-x short-only option
Group B
-F, --find=VALUE find VALUE
-d, -v, --debug, --verbose another option
-F, --find=VALUE find VALUE
-j, --jobs=N sets numeric value
-?, --help give this help list
......