summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-07-01 18:21:42 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-07-01 18:21:42 +0200
commit5d7886a9b8b4fe710c4f73d30fa3aebeabf8107b (patch)
treef4598cb5fdaa596dc11944710d8888092d196c40 /bin
parent10baf592764a6f8208f9291bd6714fecb2df33cd (diff)
bin/envstore: Applied upstream changes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/envstore16
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()