mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Prettyfing Describe() for record types.
If a record type has a name and ODesc is set to short, we now print the name instead of the full field list.
This commit is contained in:
parent
dc52846b6f
commit
08c7dd3d71
2 changed files with 11 additions and 5 deletions
14
src/Type.cc
14
src/Type.cc
|
@ -1038,10 +1038,16 @@ void RecordType::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( d->IsReadable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->AddSP("record {");
|
if ( d->IsShort() && GetTypeID() )
|
||||||
DescribeFields(d);
|
d->Add(GetTypeID());
|
||||||
d->SP();
|
|
||||||
d->Add("}");
|
else
|
||||||
|
{
|
||||||
|
d->AddSP("record {");
|
||||||
|
DescribeFields(d);
|
||||||
|
d->SP();
|
||||||
|
d->Add("}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -314,9 +314,9 @@ void add_type(ID* id, BroType* t, attr_list* attr, int /* is_event */)
|
||||||
delete [] data;
|
delete [] data;
|
||||||
}
|
}
|
||||||
|
|
||||||
tnew->SetTypeID(copy_string(id->Name()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tnew->SetTypeID(copy_string(id->Name()));
|
||||||
id->SetType(tnew);
|
id->SetType(tnew);
|
||||||
id->MakeType();
|
id->MakeType();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue