Closed eli-schwartz closed 2 years ago
I do not understand what optparse is doing! but changing this locally did not fix things for me actually... only running setup.py build_manpages with $COLUMNS set. o_0 Maybe this just needs to be exported to os.environ
Good idea, thanks for the report! I can see that argparse respects COLUMNS env var... so we just need to set it at appropriate time. Patches are welcome!
Hit this one today too.
Can anyone take a look at writing the patch? What would be the default number for COLUMNS?
This happens because we use the built-in ArgparseManpage parsers's "format_usage()". It would be ideal to built the usage string from scratch, with colors - env agnostic.
Hopefully fixed, or worked-around by 456bc2db7501be582ba8ca7eda4e5d6e15527cdc
optparse.HelpFormatter is set up with width=None, thus causing optparse to produce output which guesses at the $COLUMNS of the current terminal. The resulting manpages might look something like this:
Every rebuild of the manpages might produce a completely different binary artifact, based simply on the size of the terminal the build was done in.
See https://reproducible-builds.org/ for why this matters.
...
Please set the width to one value which is used everywhere. Manpage troff formatting codes don't need to respect terminal width.