Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

_ip: ip -6 stderr



Hi,

On a box with ipv6 disabled, tab completing `ip` in a new shell will get
error output from the `ip -6` command in _ip.  For example, doing
`ip a h<TAB>` gives (marking the point with an underscore):

$ ip a hRTNETLINK answers: Operation not supported
Dump terminated
elp_

Though it only happens on the first attempt tab completing in the shell,
it is still annoying.  Unless there's a good reason to let that error
through, it should just be discarded.

diff -aur a/Completion/Unix/Command/_ip b/Completion/Unix/Command/_ip
--- a/Completion/Unix/Command/_ip	2013-11-27 14:00:19.000000000 -0500
+++ b/Completion/Unix/Command/_ip	2014-01-07 13:10:12.299932774 -0500
@@ -40,7 +40,7 @@
 )
 subcmd_prefix_label=(
   /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/
-  ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )"
+  ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list 2>/dev/null | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )"
 )
 
 



Messages sorted by: Reverse Date, Date, Thread, Author