Skip to content

Commit

Permalink
Fix bold text on Mac terminal
Browse files Browse the repository at this point in the history
Fixes erkin#241
  • Loading branch information
ngyikp committed Apr 8, 2017
1 parent 0bf0e39 commit ff9443b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def help(self, use_colours = None):
if use_colours is None:
use_colours = sys.stdout.isatty()

print(('\033[1m%s\033[21m %s %s' if use_colours else '%s %s %s') % (self.__program, '-' if self.linuxvt else '—', self.__description))
print(('\033[1m%s\033[22m %s %s' if use_colours else '%s %s %s') % (self.__program, '-' if self.linuxvt else '—', self.__description))
print()
if self.__longdescription is not None:
desc = self.__longdescription
Expand All @@ -265,7 +265,7 @@ def help(self, use_colours = None):
print(desc)
print()

print('\033[1mUSAGE:\033[21m' if use_colours else 'USAGE:', end='')
print('\033[1mUSAGE:\033[22m' if use_colours else 'USAGE:', end='')
first = True
for line in self.__usage.split('\n'):
if first:
Expand All @@ -291,7 +291,7 @@ def help(self, use_colours = None):
maxfirstlen.append(first)
maxfirstlen = len(max(maxfirstlen, key = len))

print('\033[1mSYNOPSIS:\033[21m' if use_colours else 'SYNOPSIS')
print('\033[1mSYNOPSIS:\033[22m' if use_colours else 'SYNOPSIS')
(lines, lens) = ([], [])
for opt in self.__arguments:
opt_type = opt[0]
Expand Down Expand Up @@ -337,7 +337,7 @@ def help(self, use_colours = None):
for line in opt_help.split('\n'):
if first:
first = False
print('%s' % (line), end='\033[21;39m\n' if use_colours else '\n')
print('%s' % (line), end='\033[22;39m\n' if use_colours else '\n')
else:
print(('%s\033[%sm%s\033[39m' if use_colours else '%s%s%s') % (' ' * col, colour, line))
index += 1
Expand Down

0 comments on commit ff9443b

Please sign in to comment.