[+] update textwrap
1. do as in the source code,
either COLUMNS env variable,
otherwise 99999
for no wrap, instead of default 80 width;
This commit is contained in:
parent
67fcefbce0
commit
904c77fc29
@ -1,4 +1,5 @@
|
||||
import sys
|
||||
import os
|
||||
import io
|
||||
import json
|
||||
import subprocess
|
||||
@ -21,8 +22,8 @@ def run(argv: list[str]):
|
||||
|
||||
class c1(optparse.IndentedHelpFormatter):
|
||||
def format_option(self, *args: Any, **kwargs: Any) -> Any:
|
||||
def f1(text: str, width: Optional[int]) -> list[str]:
|
||||
width = None
|
||||
def f1(text: str, width: int) -> list[str]:
|
||||
# width = None
|
||||
return '\n'.join(
|
||||
[
|
||||
textwrap.fill('\t' + o, width, replace_whitespace=False)
|
||||
@ -45,7 +46,7 @@ def run(argv: list[str]):
|
||||
|
||||
parser = optparse.OptionParser(
|
||||
formatter=c1(
|
||||
width=None,
|
||||
width=int(os.environ.get('COLUMNS', '9999999')),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user