From a5fcde8cecd11306b0c123d3e5d8ccd52d2bb37d Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Jun 21 2018 07:23:44 +0000 Subject: Man generator indent workaround This code is used in rhpkg as a workaround for indentation on smaller screens. It is moved here beacause rhpkg generator will use rpkg module. Relates: PR #325 Signed-off-by: Ondrej Nosek --- diff --git a/pyrpkg/man_gen.py b/pyrpkg/man_gen.py index 25b2210..1bf4ee8 100644 --- a/pyrpkg/man_gen.py +++ b/pyrpkg/man_gen.py @@ -11,6 +11,7 @@ import sys +import os import datetime @@ -93,6 +94,12 @@ def generate(parser, subparsers, identity, sourceurl): man_file = sys.stdout sys.stdout = sys.stderr + # default argparse help width is 80 chars and man indent help text + # by 10 chars => 80+10 > 80(default terminal width). New help width must be + # 70 to fit in terminal + # argparse get columns value from enviroment variable + os.environ['COLUMNS'] = '70' + mf = ManFormatter(man_file, identity, sourceurl) choices = subparsers.choices