X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-doc.in;h=8f725d7901155f2f069151973cc7ea6878d635a8;hb=9886b6620ea710a4a8afd0a88271e563a64e7ea2;hp=6f77702c3329b4415512d470847014c7ec16eb78;hpb=3fd8d44544df9c4cdb6108a72154f7ebc5077dd0;p=openvswitch diff --git a/ovsdb/ovsdb-doc.in b/ovsdb/ovsdb-doc.in index 6f77702c..8f725d79 100755 --- a/ovsdb/ovsdb-doc.in +++ b/ovsdb/ovsdb-doc.in @@ -174,8 +174,38 @@ def columnGroupToNroff(table, groupXml): column = table.columns[name] if node.hasAttribute('key'): key = node.attributes['key'].nodeValue + if node.hasAttribute('type'): + type_string = node.attributes['type'].nodeValue + type_json = ovs.json.from_string(str(type_string)) + if type(type_json) in (str, unicode): + raise error.Error("%s %s:%s has invalid 'type': %s" + % (table.name, name, key, type_json)) + type_ = ovs.db.types.BaseType.from_json(type_json) + else: + type_ = column.type.value + nameNroff = "%s : %s" % (name, key) - typeNroff = "optional %s" % column.type.value.toEnglish() + + if column.type.value: + typeNroff = "optional %s" % column.type.value.toEnglish() + if (column.type.value.type == ovs.db.types.StringType and + type_.type == ovs.db.types.BooleanType): + # This is a little more explicit and helpful than + # "containing a boolean" + typeNroff += r", either \fBtrue\fR or \fBfalse\fR" + else: + if type_.type != column.type.value.type: + type_english = type_.toEnglish() + if type_english[0] in 'aeiou': + typeNroff += ", containing an %s" % type_english + else: + typeNroff += ", containing a %s" % type_english + constraints = ( + type_.constraintsToEnglish(escapeNroffLiteral)) + if constraints: + typeNroff += ", %s" % constraints + else: + typeNroff = "none" else: nameNroff = name typeNroff = typeAndConstraintsToNroff(column) @@ -287,7 +317,8 @@ Purpose if erFile: s += """ -.if !'\*[.T]'ascii' \{ +.\\" check if in troff mode (TTY) +.if t \{ .bp .SH "TABLE RELATIONSHIPS" .PP