summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 10:54:39 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 10:54:39 -0500
commit7f76e23221677376bc3676094b6136bb5a259c52 (patch)
tree013d8b95f1e7e63278daed5babc3ff4b2f4243b1 /cmd2
parent2055dfc9a601d6f2b78e44690aeff475c79369d3 (diff)
downloadcmd2-git-7f76e23221677376bc3676094b6136bb5a259c52.tar.gz
Added more validation to TableCreator
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/table_creator.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/table_creator.py b/cmd2/table_creator.py
index 2579f3c6..5d6b444d 100644
--- a/cmd2/table_creator.py
+++ b/cmd2/table_creator.py
@@ -132,7 +132,11 @@ class TableCreator:
:param cols: column definitions for this table
:param tab_width: all tabs will be replaced with this many spaces. If a row's fill_char is a tab,
then it will be converted to one space.
+ :raises: ValueError if tab_width is less than 1
"""
+ if tab_width < 1:
+ raise ValueError("Tab width cannot be less than 1")
+
self.cols = copy.copy(cols)
self.tab_width = tab_width