mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-25 05:47:59 +01:00
Fix bold text style spilling after help info on Mac terminal
Fixes https://github.com/erkin/ponysay/issues/241
This commit is contained in:
parent
0bf0e39bad
commit
914837cf9e
1 changed files with 4 additions and 4 deletions
|
@ -254,7 +254,7 @@ class ArgParser():
|
||||||
if use_colours is None:
|
if use_colours is None:
|
||||||
use_colours = sys.stdout.isatty()
|
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()
|
print()
|
||||||
if self.__longdescription is not None:
|
if self.__longdescription is not None:
|
||||||
desc = self.__longdescription
|
desc = self.__longdescription
|
||||||
|
@ -265,7 +265,7 @@ class ArgParser():
|
||||||
print(desc)
|
print(desc)
|
||||||
print()
|
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
|
first = True
|
||||||
for line in self.__usage.split('\n'):
|
for line in self.__usage.split('\n'):
|
||||||
if first:
|
if first:
|
||||||
|
@ -291,7 +291,7 @@ class ArgParser():
|
||||||
maxfirstlen.append(first)
|
maxfirstlen.append(first)
|
||||||
maxfirstlen = len(max(maxfirstlen, key = len))
|
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) = ([], [])
|
(lines, lens) = ([], [])
|
||||||
for opt in self.__arguments:
|
for opt in self.__arguments:
|
||||||
opt_type = opt[0]
|
opt_type = opt[0]
|
||||||
|
@ -337,7 +337,7 @@ class ArgParser():
|
||||||
for line in opt_help.split('\n'):
|
for line in opt_help.split('\n'):
|
||||||
if first:
|
if first:
|
||||||
first = False
|
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:
|
else:
|
||||||
print(('%s\033[%sm%s\033[39m' if use_colours else '%s%s%s') % (' ' * col, colour, line))
|
print(('%s\033[%sm%s\033[39m' if use_colours else '%s%s%s') % (' ' * col, colour, line))
|
||||||
index += 1
|
index += 1
|
||||||
|
|
Loading…
Reference in a new issue