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

Re: Make Completion



On Jul 11, 11:15pm, Nick Cross wrote:
}
} "file=($opt_args[(K)(-f|--file|--makefile)])" does not seem to be 
} returning a valid string/file

PWS has a bit of a think-o there.  (K) means to treat the keys of the
array as patterns and compare them to the subcript expression.  What
he wants is (I), which compares the subscript as a pattern to the keys
of the array -- but that returns the keys, not the values, so what is
needed is ${(v)opt_args[(I)(-f|--file|--makefile)]} to force values
to be returned.



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