Fix the -c option to calibre-debug

This commit is contained in:
Kovid Goyal 2008-07-21 10:22:22 -07:00
parent 961aa7c15b
commit 2d512fa7f7

View File

@ -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