linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: [Cooker] strange problem with "hotplug" package
Date: Thu, 08 May 2003 16:17:48 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-105241097227085@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-105222892315303@msgid-missing>

Thanks!

Stepan Kasal <kasal@math.cas.cz> wrote:
> @@ -1579,7 +1578,7 @@ main (int argc, char **argv)
>                    !strcasecmp(optarg, "if-tty"))
>              color_option = 2;
>            else
> -            show_help = 1;
> +	    error (2, 0, _("unrecognized colour option"));

A minor nit: it is customary to include the offending string
in such a diagnostic.  It's also nice to allow the user to specify
a prefix of the option argument: grep --color=al

To that end, you might want to use XARGMATCH as in e.g., coreutils' ls.c.
It does this for --time={atime, access, use, ctime, status}

	case TIME_OPTION:
	  time_type = XARGMATCH ("--time", optarg, time_args, time_types);
	  break;

With that and the corresponding declarations,
ls gives diagnostics like this:

    $ ls --time=z
    ls: invalid argument `z' for `--time'
    Valid arguments are:
      - `atime', `access', `use'
      - `ctime', `status'
    Try `ls --help' for more information.

You'd need lib/argmatch.[ch].


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

      parent reply	other threads:[~2003-05-08 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 13:45 [Cooker] strange problem with "hotplug" package Andrey Borzenkov
2003-05-06 15:54 ` Stepan Kasal
2003-05-06 20:12 ` Jim Meyering
2003-05-08 12:24 ` Stepan Kasal
2003-05-08 16:17 ` Jim Meyering [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-105241097227085@msgid-missing \
    --to=jim@meyering.net \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).