[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Allow long-options to accept more long options than one.
From: |
Ondřej Vašík |
Subject: |
Re: [PATCH] Allow long-options to accept more long options than one. |
Date: |
Wed, 19 Mar 2008 14:25:53 +0100 |
Hello,
Jim Meyering wrote:
> Here's a proposal:
>
> Add a new boolean parameter, named "strict" to make parse_long_options
> accept a --help or --version option IFF it is specified as the sole
> argument (as it does now), but that also makes it diagnose the first
> such option as invalid if there are any other options or arguments.
> Most programs would use strict=true, but not yes.c, since yes must accept
> e.g., -x --help. But uses like "sleep -x --help" and "sleep --help 60"
> would both fail with a diagnostic like e.g.,
>
> sleep: `--help' is honored only when it is the sole option
>
> It may be ok to exit with EXIT_FAILURE unconditionally. To be sure,
> you'll have to look at all uses in coreutils and any other package that
> uses parse_long_options. If that is the case, we can skip adding an
> exit_status parameter, for now.
>
> Are you interested in doing this?
Yep, ok, I'll do the change that way.
Boolean is good idea since the function name is parse_long_options - so
the name looks like it should be able to accept more than one long
option somehow(if not by default then at least optionally). But I
understand to your objections why sometimes is necessary to be strict
and accept only argc==2 . I'll contact you off the list in the
case of unclear details.
Greetings,
Ondrej Vasik
signature.asc
Description: Toto je digitálně podepsaná část zprávy