Rather than repeating the same textwrap.fill(textwrap.dedent(...))
idiom in multiple places, wrap it into util.wraptext function. It’s
not exactly equivalent since it ignores all leading white space
(rather than dedenting common spaces) and treats empty lines as
paragraph separators with paragraphs filled independently and
separated by empty lines in output.
Furthermore, make util.prompt_bool_flag and util.prompt_flag functions
call the wraptext on prompt message so that caller of those functions
doesn’t have to do it themselves. For short one-line prompts it
doesn’t end up making any difference.
Rather than repeating the same textwrap.fill(textwrap.dedent(...)) idiom in multiple places, wrap it into util.wraptext function. It’s not exactly equivalent since it ignores all leading white space (rather than dedenting common spaces) and treats empty lines as paragraph separators with paragraphs filled independently and separated by empty lines in output.
Furthermore, make util.prompt_bool_flag and util.prompt_flag functions call the wraptext on prompt message so that caller of those functions doesn’t have to do it themselves. For short one-line prompts it doesn’t end up making any difference.