++ for this idea. It would be very nice, and reduce duplication of
bundles in which the only difference is one parameter (for example,
I'm thinking of bundles for managing configuration files, some of
which use "var=value", others "var value" or "var:value", etc.)

--Diego

On Thu, Feb 4, 2010 at 2:01 PM, Bryan Ramirez <rami...@besh.com> wrote:
> Hi,
>
>
> I was wondering if there is a way to set a default argument for a body
> in cf3.
>
> For example, I have something like this that I use everywhere:
>
> body copy_from copyfrommaster(path) {
> ...
> }
>
> I would like to add the option of turning on purge since I now need it
> in one spot.  However, I don't want to have to explicitly turn it off
> every other time I use this body definition.  It'd be nice to have
> something like this:
>
> body copy_from copyfrommaster(path, purge => "false") {
> ...
>     purge => "${purge}";
> ...
> }
>
> This would default the "purge" argument to false, but I wouldn't have to
> change all of my existing code.  Right now I'm doing this:
>
> body copy_from copyfrommaster_purge(path) {
> ...
>     purge => "true";
> ...
> }
>
>
> Is there a way to do this.. and if not, can this be added?
>
> Thanks!
> -Bryan
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to