Skip to content

Commit 534dfd6

Browse files
committed
MNT #158 option to show more details
1 parent 25fcde3 commit 534dfd6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apstools/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,21 @@ def mapper(c):
8383
return "".join([mapper(c) for c in text])
8484

8585

86-
def command_list_as_table(commands):
86+
def command_list_as_table(commands, show_raw=False):
8787
"""
8888
format a command list as a pyRestTable.Table object
8989
"""
9090
tbl = pyRestTable.Table()
9191
tbl.addLabel("line #")
9292
tbl.addLabel("action")
9393
tbl.addLabel("parameters")
94+
if show_raw: # only the developer might use this
95+
tbl.addLabel("raw input")
9496
for command in commands:
95-
action, args, line_number, raw_command = command
97+
action, args, line_number, raw_command = command[:-1]
9698
row = [line_number, action, ", ".join(map(str, args))]
99+
if show_raw:
100+
row.append(str(raw_command))
97101
tbl.addRow(row)
98102
return tbl
99103

0 commit comments

Comments
 (0)