zsh-workers
 help / color / mirror / code / Atom feed
* Zsh Completion - Bug report
@ 2016-08-19 10:10 Stefano Balzan
  2016-08-19 15:58 ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Balzan @ 2016-08-19 10:10 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Hello,
I've probably found a bug in the 'ip neigh' commands set.
Zsh completion sugguests using 'lladr' instead of 'lladdr' resulting in the
following error:
"Error: either "to" is duplicate, or "lladr" is a garbage."

It took me a while to find the subtle difference, since I rarely use the ip
tools and it could be misleading for several users.


Regards,
Stefano Balzan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Zsh Completion - Bug report
  2016-08-19 10:10 Zsh Completion - Bug report Stefano Balzan
@ 2016-08-19 15:58 ` Daniel Shahaf
  2016-08-19 17:26   ` Axel Beckert
  2016-08-19 17:38   ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Shahaf @ 2016-08-19 15:58 UTC (permalink / raw)
  To: Stefano Balzan; +Cc: zsh-workers

Stefano Balzan wrote on Fri, Aug 19, 2016 at 12:10:02 +0200:
> Hello,
> I've probably found a bug in the 'ip neigh' commands set.
> Zsh completion sugguests using 'lladr' instead of 'lladdr' resulting in the
> following error:
> "Error: either "to" is duplicate, or "lladr" is a garbage."
> 
> It took me a while to find the subtle difference, since I rarely use the ip
> tools and it could be misleading for several users.

Thanks:

diff --git Completion/Unix/Command/_ip Completion/Unix/Command/_ip
index 1e39491..9833cdb 100644
--- Completion/Unix/Command/_ip
+++ Completion/Unix/Command/_ip
@@ -285,7 +285,7 @@ local -a neigh_add_cmds
 _regex_words neigh-add-commands "neighbour add command" \
   't*o:add new neighbour IP address:$subcmd_ipaddr' \
   'dev:specify network device:$subcmd_dev' \
-  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
+  'l*ladrr:specify link layer (MAC) address or null:$subcmd_lladdr' \
   'n*ud:specify neighbour unreachability detection state:$subcmd_nud'
 # to-address without keyword can appear first
 neigh_add_cmds=( "(" $subcmd_ipaddr "|" ")" "$reply[@]" "#")

One other issue: the man page synopsis is
.
       ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ] … } …
.
but the word "lladdrr" is completed at argv[3], not at argv[4] as I'd
expect from the synopsis.  I'm not familiar with ip(8) so I'll leave
investigating this to someone else...

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Zsh Completion - Bug report
  2016-08-19 15:58 ` Daniel Shahaf
@ 2016-08-19 17:26   ` Axel Beckert
  2016-08-19 18:03     ` Stefano Balzan
  2016-08-19 17:38   ` Bart Schaefer
  1 sibling, 1 reply; 6+ messages in thread
From: Axel Beckert @ 2016-08-19 17:26 UTC (permalink / raw)
  To: zsh-workers; +Cc: Stefano Balzan

Hi Daniel,

On Fri, Aug 19, 2016 at 03:58:29PM +0000, Daniel Shahaf wrote:
> Stefano Balzan wrote on Fri, Aug 19, 2016 at 12:10:02 +0200:
> > Zsh completion sugguests using 'lladr' instead of 'lladdr' resulting in the
> > following error:
[...]
> -  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
> +  'l*ladrr:specify link layer (MAC) address or null:$subcmd_lladdr' \
           ^

There's a typo in your typo fix. Should be:

-  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
+  'l*laddr:specify link layer (MAC) address or null:$subcmd_lladdr' \

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Zsh Completion - Bug report
  2016-08-19 15:58 ` Daniel Shahaf
  2016-08-19 17:26   ` Axel Beckert
@ 2016-08-19 17:38   ` Bart Schaefer
  1 sibling, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2016-08-19 17:38 UTC (permalink / raw)
  To: zsh-workers

On Aug 19,  3:58pm, Daniel Shahaf wrote:
}
} -  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
} +  'l*ladrr:specify link layer (MAC) address or null:$subcmd_lladdr' \

Isn't that STILL a typo?  Should be l*laddr ?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Zsh Completion - Bug report
  2016-08-19 17:26   ` Axel Beckert
@ 2016-08-19 18:03     ` Stefano Balzan
  2016-08-20  3:07       ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Balzan @ 2016-08-19 18:03 UTC (permalink / raw)
  To: zsh-workers, Stefano Balzan

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

Thank you, I think your fix should do, pay attention to the typo Axel
pointed out though.
I'm no expert of the 'ip' command, anyway this is how I would add an arp
entry:

 "ip neigh add 192.168.1.1 lladdr 12:34:56:78:ab:cd [other parameters]"

Probably the lladdr keyword (link layer address) should be suggested at
argv[4], but I'm not completely sure.

regards,
Stefano

2016-08-19 19:26 GMT+02:00 Axel Beckert <abe@deuxchevaux.org>:

> Hi Daniel,
>
> On Fri, Aug 19, 2016 at 03:58:29PM +0000, Daniel Shahaf wrote:
> > Stefano Balzan wrote on Fri, Aug 19, 2016 at 12:10:02 +0200:
> > > Zsh completion sugguests using 'lladr' instead of 'lladdr' resulting
> in the
> > > following error:
> [...]
> > -  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
> > +  'l*ladrr:specify link layer (MAC) address or null:$subcmd_lladdr' \
>            ^
>
> There's a typo in your typo fix. Should be:
>
> -  'l*ladr:specify link layer (MAC) address or null:$subcmd_lladdr' \
> +  'l*laddr:specify link layer (MAC) address or null:$subcmd_lladdr' \
>
>                 Kind regards, Axel
> --
> /~\  Plain Text Ribbon Campaign                   | Axel Beckert
> \ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org
> (Mail)
>  X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org
> (Mail+Jabber)
> / \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/
> (Web)
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Zsh Completion - Bug report
  2016-08-19 18:03     ` Stefano Balzan
@ 2016-08-20  3:07       ` Daniel Shahaf
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Shahaf @ 2016-08-20  3:07 UTC (permalink / raw)
  To: Stefano Balzan; +Cc: zsh-workers

Stefano Balzan wrote on Fri, Aug 19, 2016 at 20:03:50 +0200:
> Thank you, I think your fix should do, pay attention to the typo Axel
> pointed out though.

Pushed with the correction — thanks everyone for the reviews.

> I'm no expert of the 'ip' command, anyway this is how I would add an arp
> entry:
> 
>  "ip neigh add 192.168.1.1 lladdr 12:34:56:78:ab:cd [other parameters]"
> 
> Probably the lladdr keyword (link layer address) should be suggested at
> argv[4], but I'm not completely sure.

Thanks for the example.  Currently, argv[4] in your command is completed
correctly but argv[3] completes as argv[4]; that is: completing argv[3]
offers lladdr and doesn't offer "an IP address".

It's probably not hard to fix, but I'll leave it to someone else...

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-20  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19 10:10 Zsh Completion - Bug report Stefano Balzan
2016-08-19 15:58 ` Daniel Shahaf
2016-08-19 17:26   ` Axel Beckert
2016-08-19 18:03     ` Stefano Balzan
2016-08-20  3:07       ` Daniel Shahaf
2016-08-19 17:38   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).