X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-doc.in;h=7b783e1a0414c9e29b329c3b30ec44133b844ae8;hb=71baec0655e41bb93f125d162bc62cc9da0be73b;hp=5ae6706e570542242a8f827fba9d0378e6820bb4;hpb=9f88469c0cbc8fa13a97e7b5b7902566e730f72c;p=openvswitch diff --git a/ovsdb/ovsdb-doc.in b/ovsdb/ovsdb-doc.in index 5ae6706e..7b783e1a 100755 --- a/ovsdb/ovsdb-doc.in +++ b/ovsdb/ovsdb-doc.in @@ -16,9 +16,9 @@ argv0 = sys.argv[0] def textToNroff(s, font=r'\fR'): def escape(match): c = match.group(0) - if c == '-': - if font == r'\fB': - return r'\-' + if c.startswith('-'): + if c != '-' or font == r'\fB': + return '\\' + c else: return '-' if c == '\\': @@ -31,7 +31,7 @@ def textToNroff(s, font=r'\fR'): raise error.Error("bad escape") # Escape - \ " ' as needed by nroff. - s = re.sub('([-"\'\\\\])', escape, s) + s = re.sub('(-[0-9]|[-"\'\\\\])', escape, s) if s.startswith('.'): s = '\\' + s return s @@ -144,7 +144,8 @@ def blockXmlToNroff(nodes, para='.PP'): def typeAndConstraintsToNroff(column): type = column.type.toEnglish(escapeNroffLiteral) - constraints = column.type.constraintsToEnglish(escapeNroffLiteral) + constraints = column.type.constraintsToEnglish(escapeNroffLiteral, + textToNroff) if constraints: type += ", " + constraints if column.unique: @@ -187,7 +188,8 @@ def columnGroupToNroff(table, groupXml): nameNroff = "%s : %s" % (name, key) if column.type.value: - typeNroff = "optional %s" % column.type.value.toEnglish() + typeNroff = "optional %s" % column.type.value.toEnglish( + escapeNroffLiteral) 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 @@ -201,7 +203,8 @@ def columnGroupToNroff(table, groupXml): else: typeNroff += ", containing a %s" % type_english constraints = ( - type_.constraintsToEnglish(escapeNroffLiteral)) + type_.constraintsToEnglish(escapeNroffLiteral, + textToNroff)) if constraints: typeNroff += ", %s" % constraints else: