This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
# this first bit is to enable multiline help text. apparently this is a known problem with argparse. | |
# Solution jacked from http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-in-the-help-text | |
import textwrap as _textwrap | |
class MultilineFormatter(argparse.HelpFormatter): | |
def _fill_text(self, text, width, indent): | |
text = self._whitespace_matcher.sub(' ', text).strip() | |
paragraphs = text.split('|n ') |