This commit is contained in:
Kovid Goyal 2012-11-23 11:36:53 +05:30
parent 5ec9b392a7
commit 68c77002af
2 changed files with 11 additions and 1 deletions

View File

@ -15,7 +15,13 @@ def option_parser():
parser = OptionParser(usage='''\ parser = OptionParser(usage='''\
%prog [options] %prog [options]
Run an embedded python interpreter. Various command line interfaces useful for debugging calibre. With no options,
this command starts an embedded python interpreter. You can also run the main
calibre GUI and the calibre viewer in debug mode.
It also contains interfaces to various bits of calibre that do not have
dedicated command line tools, such as font subsetting, tweaking ebooks and so
on.
''') ''')
parser.add_option('-c', '--command', help='Run python code.', default=None) parser.add_option('-c', '--command', help='Run python code.', default=None)
parser.add_option('-e', '--exec-file', default=None, help='Run the python code in file.') parser.add_option('-e', '--exec-file', default=None, help='Run the python code in file.')

View File

@ -31,6 +31,10 @@ class CustomHelpFormatter(IndentedHelpFormatter):
def format_usage(self, usage): def format_usage(self, usage):
from calibre.utils.terminal import colored from calibre.utils.terminal import colored
parts = usage.split(' ')
if parts:
parts[0] = colored(parts[0], fg='yellow', bold=True)
usage = ' '.join(parts)
return colored(_('Usage'), fg='blue', bold=True) + ': ' + usage return colored(_('Usage'), fg='blue', bold=True) + ': ' + usage
def format_heading(self, heading): def format_heading(self, heading):