diff --git a/IPython/Extensions/envpersist.py b/IPython/Extensions/envpersist.py index a0523ba..3a9463c 100644 --- a/IPython/Extensions/envpersist.py +++ b/IPython/Extensions/envpersist.py @@ -35,8 +35,6 @@ def persist_env(self, parameter_s=''): %env -p - print all persistent env modifications """ - - if not parameter_s.strip(): return os.environ.data @@ -82,8 +80,11 @@ def persist_env(self, parameter_s=''): os.environ[k] = v db['stored_env'] = env - - +def env_completer(self,event): + """ Custom completer that lists all env vars """ + return os.environ.keys() ip.expose_magic('env', persist_env) +ip.set_hook('complete_command',env_completer, str_key = '%env') + diff --git a/doc/ChangeLog b/doc/ChangeLog index a3a9807..d37a567 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -11,6 +11,8 @@ trivial custom completers * clearcmd.py: shadow history compression & erasing + + * envpersist.py, history.py: %env (sh profile only), %hist completers 2007-08-21 Ville Vainio