[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Cooker] strange problem with "hotplug" package
From: |
Jim Meyering |
Subject: |
Re: [Cooker] strange problem with "hotplug" package |
Date: |
Thu, 08 May 2003 18:17:48 +0200 |
Thanks!
Stepan Kasal <address@hidden> 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].
- Re: [Cooker] strange problem with "hotplug" package, Andrey Borzenkov, 2003/05/06
- Re: [Cooker] strange problem with "hotplug" package, Stepan Kasal, 2003/05/06
- Re: [Cooker] strange problem with "hotplug" package, Jim Meyering, 2003/05/06
- Iconsistent ls sorting with and without `v', Andrey Borzenkov, 2003/05/09
- Re: Iconsistent ls sorting with and without `v', Jim Meyering, 2003/05/10
- Re: Iconsistent ls sorting with and without `v', Andrey Borzenkov, 2003/05/10
- Re: Iconsistent ls sorting with and without `v', Stepan Kasal, 2003/05/11
- Re: Iconsistent ls sorting with and without `v', Thierry Vignaud, 2003/05/22