I have had exactly the same thoughts recently.

Basically what would be nice is the ability to define real functions that accepts arguments and return values to vars.

Maybe something like:

vars:

"foo" function => bar("$(arg1)","$(arg2)");

...

body function bar(a,b)
{
return => execresult("somecommand $(a) $(b)");
}


On Apr 9, 2010 10:53am, Jean-Noël Rivasseau <elva...@gmail.com> wrote:
Hello,

There is an execresult function that I use quite a lot to fill a variable in my bundles. Is it possible to somehow modularize that in a method and have the variable somehow be some kind of "output" from the method?


What I mean is that I have many places in my code where I do:

vars:
foo string => execresult("verylongandcomplexcommandhere myArgument");
and I'd like to avoid repeating this code all the time. Any options to do that?


--
Jean-Noël Rivasseau


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to