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

Re: histsubstpattern in zmv



2023-06-02 16:09:53 +0100, Stephane Chazelas:
[...]
> May be worth applying the patch below today for future-proofing


$ grep -rnP '\$[~^=#]?([$!#?*@]|\w+)(\[[^]]*\])?:(?![aAceghlpPqQrstux])\w' Completion
Completion/Solaris/Command/_ipadm:139:  proto_all_properties=( $^proto_all_properties:value:_ipadm_get_possible_values )

is more complete (accounts for the $# $!... special parameters
and $~var, $^var...) and finds that extra one.

I likely still forget some more.

diff --git a/Completion/Solaris/Command/_ipadm b/Completion/Solaris/Command/_ipadm
index 34d1eacba..c59fc8108 100644
--- a/Completion/Solaris/Command/_ipadm
+++ b/Completion/Solaris/Command/_ipadm
@@ -136,7 +136,7 @@ _ipadm() {
 	proto_icmp_properties=( "max_buf" "recv_buf" "send_buf" )
 	proto_all_properties=( $proto_ipv4_properties $proto_ipv6_properties $proto_tcp_properties
 		$proto_udp_properties $proto_sctp_properties $proto_icmp_properties )
-	proto_all_properties=( $^proto_all_properties:value:_ipadm_get_possible_values )
+	proto_all_properties=( ${^proto_all_properties}:value:_ipadm_get_possible_values )
 
 	proto_propproperties=( "proto" "property" "perm" "current" "persistent" "default" "possible" )
 

> and a note in the manual that it's unwise to leave a parameter
> expansion un-braced if it's followed by a ":"?
[...]

unless the ksharrays option is enabled.

-- 
Stephane




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