diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-07-01 18:21:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-07-01 18:21:42 +0200 |
commit | 5d7886a9b8b4fe710c4f73d30fa3aebeabf8107b (patch) | |
tree | f4598cb5fdaa596dc11944710d8888092d196c40 /bin | |
parent | 10baf592764a6f8208f9291bd6714fecb2df33cd (diff) |
bin/envstore: Applied upstream changes
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/envstore | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/envstore b/bin/envstore index e314a12..87f797a 100755 --- a/bin/envstore +++ b/bin/envstore @@ -75,13 +75,17 @@ elif command == "eval": for k, v in store.iteritems(): print "export " + k + "=" + v elif command == "save": - key = get_key() + arg = get_key() - try: - value = os.environ[key] - except KeyError: - print >> sys.stderr, key + " does not exist in environment" - sys.exit(3) + if "=" in arg: + key, value = arg.split('=', 2) + + else: + try: + value = os.environ[key] + except KeyError: + print >> sys.stderr, key + " does not exist in environment" + sys.exit(3) store[key] = value save_store() |