- set default to an enum type

Hi everyone,

I have a variable that has &optional &default attributes.
I want the &default attribute to have a value of an enum.

So if the enum is : type color: enum { Red, White, Blue, };
c: color &default=Red;

Does not work…

Any ideas on the correct syntax ?

Thank you

That is the correct syntax.


$ cat color.bro
type Color: enum {Red, Green, Blue};
type Whatever: record {
    color: Color &default=Red;

event bro_init()
    local t: Whatever;
    print t$color;

$ bro color.bro