Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] completion/_make: add completion for shell function generated targets
On 2025-09-08 10:46:58 -0400, Aaron Schrab wrote:
> At 21:45 +0800 08 Sep 2025, Ling Wang <lingwang@xxxxxxxxxxx> wrote:
> > The gnu-make allows calling shell functions in variable assignment,
> > which then can be used to generate dynamic target. A simple example
> > like:
> > ```
> > TARGETS := $(shell echo 'a b c') $(shell echo 'd')
> > $(TARGETS):
> > @echo "Target $@"
> > ```
> >
> > Which allows you to use `make a` and so on.
> >
> > For now, the completion would shown as:
> > ```
> > > make
> > $(shell echo 'a b c') $(shell echo 'd')
> > ```
> >
> > After modification, the completion would be:
> > ```
> > > make
> > a b c d
> > ```
>
> This seems to allow executing arbitrary code from the Makefile during
> completion, which I think is a bad idea.
I completely agree. Completions should be assumed to be always safe.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author