From 149d55ad7dbdc2bc1ba145053f44e45565afd693 Mon Sep 17 00:00:00 2001 From: Ales Raszka Date: Sep 30 2015 07:51:45 +0000 Subject: Fix man page formatting Line wrap is set to default terminal width (80 characters) Signed-off-by: Ales Raszka --- diff --git a/src/rpkg_man_page.py b/src/rpkg_man_page.py index 468be6e..0286c04 100644 --- a/src/rpkg_man_page.py +++ b/src/rpkg_man_page.py @@ -12,6 +12,7 @@ import sys import datetime +import os # We could substitute the "" in .TH with the rpkg version if we knew it @@ -89,6 +90,12 @@ def generate(parser, subparsers): 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'] = str(70) + mf = ManFormatter(man_file) choices = subparsers.choices