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

Re: [PATCH] Update make completion with gnu options



On Jul 12,  4:46pm, Bart Schaefer wrote:
} Subject: Re: [PATCH] Update make completion with gnu options
}
} On Jul 12,  7:46am, Nick Cross wrote:
} }
} } +    file=${(v)opt_args[(I)(-f|--file|--makefile)]}
} 
} The (I) subscript flag returns an array of all the possible matching
} elements, so if there happens to be more than one file option the
} above will not assign a useful file name to $file.

On the other hand, I see that you've no longer declared file as an
array, and the -f options are completed mutually-exclusively, so that
would only happen if someone explicitly typed out a command with more
than one such option and then attempted to complete targets.

However, the (i) flag would still probably be "more correct" here.



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