我在用于配置 Docopt 的文档字符串中有一些详细的选项规范。有些项目很长。有没有一种方法可以包装文本以使其更清晰或更容易适应线宽?
假设文档字符串中的相关文本如下:
Usage:
program [options]
Options:
-h, --help Show this help message.
-c, --configuration=CONF Configuration (file) [default: None]
-f, --files=FILESLIST Comma-delimited list of input data files [default: 169888_ttH_el.root]
-v, --variables=VARIABLESLIST Comma-delimited list of variables to plot [default: trk_pt]
-t, --tree=TREE Tree in input data files [default: mini]
-u, --username=USERNAME Username
-t, --topanalysis=DIRECTORY Directory of TopRootCore or TopAnalysis [default: /home/user/Dropbox/TopAnalysis]
-s, --superlongoption=TEST This is a very long option that requires a bit of text to explain it. [default: 101001011011101010010100110101010]
--version Show the version and exit.
是否可以将文本包装成类似以下的样式?
Usage:
program [options]
Options:
-h, --help Show this help message.
-c, --configuration=CONF Configuration (file) [default: None]
-f, --files=FILESLIST Comma-delimited list of input data files
[default: 169888_ttH_el.root]
-v, --variables=VARIABLESLIST Comma-delimited list of variables to plot
[default: trk_pt]
-t, --tree=TREE Tree in input data files [default: mini]
-u, --username=USERNAME Username
-t, --topanalysis=DIRECTORY Directory of TopRootCore or TopAnalysis
[default: /home/user/Dropbox/TopAnalysis]
-s, --superlongoption=TEST This is a very long option that requires a
bit of text to explain it.
[default: 101001011011101010010100110101010]
--version Show the version and exit.