Skip to content

Commit

Permalink
only print item header in rotate view if there are more than one item…
Browse files Browse the repository at this point in the history
…s. make rotate header prettier.
  • Loading branch information
kellyjonbrazil committed Dec 23, 2021
1 parent 170b0c8 commit efec9b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
jtbl changelog

20211223 v1.2.3
- Remove item header from rotate view if there is only one item
- Add separator line under item header in rotate view

20211222 v1.2.2
- Use nicer grid lines for tables

Expand Down
7 changes: 4 additions & 3 deletions jtbl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tabulate
import shutil

__version__ = '1.2.2'
__version__ = '1.2.3'


def ctrlc(signum, frame):
Expand Down Expand Up @@ -260,13 +260,14 @@ def main():
columns=columns,
rotate=True)
if succeeeded:
print(f'item: {idx}')
if len(json_data) > 1:
print(f'item: {idx}')
print('─' * columns)
print(result)
print()
else:
print_error(result)


else:
succeeeded, result = make_table(data=json_data,
truncate=truncate,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='jtbl',
version='1.2.2',
version='1.2.3',
author='Kelly Brazil',
author_email='kellyjonbrazil@gmail.com',
description='A simple cli tool to print JSON and JSON Lines data as a table in the terminal.',
Expand Down

0 comments on commit efec9b2

Please sign in to comment.