Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_ip: ip -6 stderr
- X-seq: zsh-workers 32238
- From: Mark Oteiza <mvoteiza@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: _ip: ip -6 stderr
- Date: Tue, 07 Jan 2014 13:33:40 -0500
- Cancel-lock: sha1:mb0mG/C/hp9dpajmz1ZCvyqJRcI=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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