Can plugins provide macros? Reading the docs it se...
# plugins
g
Can plugins provide macros? Reading the docs it seems like no; they have to be put into a file and registered separately - but it'd be very helpful.
Use-case is to be able to do defaultable "parametrization" -- I have 5 things I want to parametrize on the run command of my plugin. This is the 5 flavors of kubectl resource action - create, apply, delete, replace, describe. I don't want to force users to manually deal with that. ๐Ÿ™‚
E.g., if my raw target is
cluster/dash:k8s
that'd likely be "describe" and then I want
cluster/dash:k8s.apply
, or something to that effect. So essentially parametrize, but to the best of my understanding and testing I can't put a Parametrize in the default of a field either. And that is more verbose... ๐Ÿ˜›
c
sounds like a command/option to the run command, something like:
Copy code
./pants run --kubectl-cmd=apply cluster/dash:k8s
kubectl-cmd
could default to
describe
for instance. In that case, itโ€™s a subsystem you want to register for that to work.
h
A plugin can provide a target generator that in turn generates these 5 targets, I think?
g
Both good options, thanks both of you! I think a target generator will be more ergonomic (less noise to remember). I'll investigate that and see how it works.