mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #2863 (ebook-convert --list-recipes requires input and output files to be specified (0.6.0b14))
This commit is contained in:
parent
4cde1c91e7
commit
a0d6df759d
@ -193,6 +193,22 @@ class ProgressBar(object):
|
||||
self.log('%d%% %s'%(percent, msg))
|
||||
|
||||
def create_option_parser(args, log):
|
||||
if '--version' in args:
|
||||
from calibre.constants import __appname__, __version__, __author__
|
||||
log(os.path.basename(args[0]), '('+__appname__, __version__+')')
|
||||
log('Created by:', __author__)
|
||||
raise SystemExit(0)
|
||||
if '--list-recipes' in args:
|
||||
from calibre.web.feeds.recipes import titles
|
||||
log('Available recipes:')
|
||||
for title in sorted(titles):
|
||||
try:
|
||||
log('\t'+title)
|
||||
except:
|
||||
log('\t'+repr(title))
|
||||
log('%d recipes available'%len(titles))
|
||||
raise SystemExit(0)
|
||||
|
||||
parser = option_parser()
|
||||
if len(args) < 3:
|
||||
print_help(parser, log)
|
||||
|
@ -406,9 +406,6 @@ OptionRecommendation(name='language',
|
||||
recommended_value=None, level=OptionRecommendation.LOW,
|
||||
help=_('Set the language.')),
|
||||
|
||||
OptionRecommendation(name='list_recipes',
|
||||
recommended_value=False, help=_('List available recipes.')),
|
||||
|
||||
]
|
||||
|
||||
input_fmt = os.path.splitext(self.input)[1]
|
||||
@ -611,16 +608,6 @@ OptionRecommendation(name='list_recipes',
|
||||
self.setup_options()
|
||||
if self.opts.verbose:
|
||||
self.log.filter_level = self.log.DEBUG
|
||||
if self.opts.list_recipes:
|
||||
from calibre.web.feeds.recipes import titles
|
||||
self.log('Available recipes:')
|
||||
for title in sorted(titles):
|
||||
try:
|
||||
self.log('\t'+title)
|
||||
except:
|
||||
self.log('\t'+repr(title))
|
||||
self.log('%d recipes available'%len(titles))
|
||||
raise SystemExit(0)
|
||||
self.flush()
|
||||
|
||||
# Run any preprocess plugins
|
||||
|
Loading…
x
Reference in New Issue
Block a user