diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index 3a34fa8675..0650fc73e9 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -70,11 +70,18 @@ def option_recommendation_to_cli_option(add_option, rec): switches.append('--'+opt.long_switch) attrs = dict(dest=opt.name, help=opt.help, choices=opt.choices, default=rec.recommended_value) - if opt.long_switch == 'verbose': - attrs['action'] = 'count' if isinstance(rec.recommended_value, type(True)): attrs['action'] = 'store_false' if rec.recommended_value else \ 'store_true' + else: + if isinstance(rec.recommended_value, int): + attrs['type'] = 'int' + if isinstance(rec.recommended_value, float): + attrs['type'] = 'float' + + if opt.long_switch == 'verbose': + attrs['action'] = 'count' + attrs.pop('type', '') add_option(Option(*switches, **attrs)) def add_input_output_options(parser, plumber):