Skip to content

Commit

Permalink
Merge pull request #55 from mkaz/wgxo-master
Browse files Browse the repository at this point in the history
Rename arg to label-before
  • Loading branch information
mkaz authored May 13, 2020
2 parents e90cf1c + 3de2080 commit d9ca5b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
name='termgraph',
packages=['termgraph'],
entry_points={'console_scripts': ['termgraph=termgraph.termgraph:main']},
version='0.2.0',
version='0.2.2',
author="mkaz",
author_email="[email protected]",
url='https://github.com/mkaz/termgraph',
Expand Down
10 changes: 5 additions & 5 deletions termgraph/termgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from colorama import init


VERSION = '0.2.0'
VERSION = '0.2.2'

init()

Expand Down Expand Up @@ -118,7 +118,7 @@ def init_args():
help='Verbose output, helpful for debugging'
)
parser.add_argument(
'--reverse',
'--label-before',
action='store_true',
help='Display the values before the bars'
)
Expand Down Expand Up @@ -217,7 +217,7 @@ def horiz_rows(labels, data, normal_dat, args, colors, doprint = True):
# Hide the labels.
label = ''
else:
if args['reverse']:
if args['label_before']:
fmt = "{:<{x}}"
else:
fmt = "{:<{x}}: "
Expand All @@ -233,7 +233,7 @@ def horiz_rows(labels, data, normal_dat, args, colors, doprint = True):
if j > 0:
len_label = len(label)
label = ' ' * len_label
if args['reverse']:
if args['label_before']:
fmt = '{}{}'
else:
fmt = ' {}{}'
Expand Down Expand Up @@ -417,7 +417,7 @@ def chart(colors, data, args, labels):
if not args['stacked']:
normal_dat = normalize(data, args['width'])
sys.stdout.write('\033[0m') # no color
for row in horiz_rows(labels, data, normal_dat, args, colors, not args['reverse']):
for row in horiz_rows(labels, data, normal_dat, args, colors, not args['label_before']):
if not args['vertical']:
print_row(*row)
else:
Expand Down

0 comments on commit d9ca5b5

Please sign in to comment.