Re: [PATCH] Fix client_add_key for minus

"Markus Dolze" <[email protected]> Wed, 10 Oct 2012 18:47:48 +0200
Newsgroups gmane.comp.sysutils.lcdproc
Message-ID <[email protected]>
-------- Original-Nachricht --------
> Datum: Fri, 5 Oct 2012 08:12:57 +0100
> Von: Simon Dawson <[email protected]>
> An: [email protected]
> Betreff: [Lcdproc] [PATCH] Fix client_add_key for minus

> Calling client_add_key as follows
> 
>   client_add_key -
> 
> will fail. However using an explicit -shared option, like this:
> 
>   client_add_key -shared -
> 
> will succeed. This is caused by a failure to parse the - key token, which
> is
> mistaken for the first character of an option argument.
> 
> The client_add_key command also returns a spurious "success" message when
> a
> malformed option is supplied.
> 
> The attached patch fixes both issues.

Hi,

after looking into this, I am convinced that this behavior is intentionally to some degree.

Therefore, you should use 

  client_add_key -shared -

if you want to use the minus character as a key. I will update to documentation to describe this.

A similar thing exists with menu items that could not have names starting with a minus character if using the short version of menu_add_item. The documentation has been updates while applying your other patch.

Regards,
Markus