Skip to content

Commit 2419c1d

Browse files
committed
Default width to console window width
1 parent f013a94 commit 2419c1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

processinghistory/cmdline/historyview.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import argparse
66
import textwrap
7+
import shutil
78

89
from osgeo import gdal
910
from processinghistory import history
@@ -16,6 +17,7 @@ def getCmdargs():
1617
"""
1718
Get command line arguments
1819
"""
20+
defaultWidth = shutil.get_terminal_size().columns
1921
p = argparse.ArgumentParser(
2022
description=("Display simple text view of processing history " +
2123
"from the given file. Default will display the metadata " +
@@ -26,7 +28,7 @@ def getCmdargs():
2628
"selected ancestor to view, instead of the file itself"))
2729
p.add_argument("--showparents", default=False, action="store_true",
2830
help="Display parents instead of metadata dictionary. ")
29-
p.add_argument("-w", "--width", default=80, type=int,
31+
p.add_argument("-w", "--width", default=defaultWidth, type=int,
3032
help="Width of display screen in characters (default=%(default)s)")
3133
cmdargs = p.parse_args()
3234
return cmdargs

0 commit comments

Comments
 (0)