On 12/07/16 18:08, Ted Zlatanov wrote:
> Right now, getclassmetatags("myclass") and getvariablemetatags("myvar")
> return an slist of all the tags for their respective class or variable.
> 
> In 3.9.0, I found myself needing a specific tag value instead of all of
> them, so I was doing
> 
>     regex_replace(nth(grep("^foo=.*", getclassmetatags("myclass")), 0), 
> "^foo=", "", "T")
> 
> to get the value of the "foo=bar" tag of "myclass". So I would love to
> have an optional second argument getclassmetatags("myclass", "foo") and
> getvariablemetatags("myvar", "foo") that give me a slist of the specific
> tag values, removing the key. What do you think? It would be backwards
> compatible and fairly easy to implement.

Would it need to be an slist? If you ask for a specific tag you'll get
just one value, no? Or do you mean that it should be an expression?

I guess this makes sense, but just out of curiosity, can you share some
more about why you needed this, if it's not too secret? :-)

-- 
Kristian

-- 
You received this message because you are subscribed to the Google Groups 
"dev-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dev-cfengine/5785E118.6050602%40cfengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to