def write_text(self, text):
        """Writes re-indented text into the buffer.
        """

        should_indent = False
        rows = []

        for row in text.split('\n'):

            if should_indent:
                row = '    {}'.format(row)

            if '\b' in row:
                row = row.replace('\b', '', 1)
                should_indent = True
            elif not len(row.strip()):
                should_indent = False

            rows.append(row)

        self.write("{}\n".format('\n'.join(rows)))
Writes re-indented text into the buffer.
        
scripts/gen-cli-docs.py