[Refdb-users] to quote or not to quote (Curious refdbc -C "getref ..." behaviour)
Status: Beta
Brought to you by:
mhoenicka
|
From: Markus H. <mar...@mh...> - 2004-03-31 00:07:31
|
Marc Herbert writes:
> > In retrospect it is easy to see that, without quotes, refdbc interpreted
> > the "-h" as an option to refdbc and ignored the "-C getref", effectively
> > executing << refdbc -h >>.
>
> Mmmm... I don't think user input should ever be "ignored", but rather
> trigger an error message, but this is another story.
>
The manual says:
-h
Displays help and usage screen, then exits.
This behaviour is documented. Asking for help should never do anything
but display the help, otherwise users might be reluctant to run it at
all.
> --- refdbc.c 2003/03/11 18:50:42 1.1
> +++ refdbc.c 2003/03/11 21:07:58
> @@ -338,6 +338,11 @@
> the_pager[PREFS_BUF_LEN-1] = '\0';
> break;
> case 'C':
> + if (!find_command(optarg, commands))
> + {
> + fprintf (stderr, "%s: No such command for refdb.\n", optarg);
> + return (-1);
> + }
> strncpy(the_cmd, optarg, 31);
> the_cmd[31] = '\0';
> n_batchmode = 1;
This unfortunately breaks the refdbc -C "getref -h" workaround. I'll
have to figure out a way to have both, not one or the other.
regards,
Markus
--
Markus Hoenicka
mar...@ca...
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de
|