diff --git a/src/calibre/debug.py b/src/calibre/debug.py index ab990b38a8..aecff15351 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -19,7 +19,7 @@ Run an embedded python interpreter. parser.add_option('--update-module', help='Update the specified module in the frozen library. '+ 'Module specifications are of the form full.name.of.module,path_to_module.py', default=None ) - parser.add_option('-c', help='Run python code.', default=None, dest='command') + parser.add_option('-c', '--command', help='Run python code.', default=None) return parser def update_zipfile(zipfile, mod, path): @@ -43,6 +43,7 @@ def main(args=sys.argv): mod, path = opts.update_module.partition(',')[0], opts.update_module.partition(',')[-1] update_module(mod, os.path.expanduser(path)) elif opts.command: + sys.argv = args[:1] exec opts.command else: from IPython.Shell import IPShellEmbed