From d4f73115a876c719324c0c2ba921b655909123d5 2013-08-23 07:14:22 From: MinRK Date: 2013-08-23 07:14:22 Subject: [PATCH] remember argv used to initialize an Application store a copy so it can't be manipulated --- diff --git a/IPython/config/application.py b/IPython/config/application.py index 561269c..92ceca1 100644 --- a/IPython/config/application.py +++ b/IPython/config/application.py @@ -142,6 +142,9 @@ class Application(SingletonConfigurable): # The version string of this application. version = Unicode(u'0.0') + + # the argv used to initialize the application + argv = List(Unicode) # The log level for the application log_level = Enum((0,10,20,30,40,50,'DEBUG','INFO','WARN','ERROR','CRITICAL'), @@ -454,6 +457,7 @@ class Application(SingletonConfigurable): def parse_command_line(self, argv=None): """Parse the command line arguments.""" argv = sys.argv[1:] if argv is None else argv + self.argv = list(argv) if argv and argv[0] == 'help': # turn `ipython help notebook` into `ipython notebook -h`