diff options
author | Joe Robinson <joe@lc8n.com> | 2020-12-01 11:25:15 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2020-12-01 11:25:15 +0000 |
commit | 8ec80fddc0b814860af17556c41e361be4d8ea9e (patch) | |
tree | e22ecf3038e28517d6f6a6b51fc8009f70c77381 | |
parent | f3ef5e6f63baad99f61eef6c6d28eaba335263a9 (diff) | |
parent | 0a819ab26d8670dfbfb1c0714d5f911aed7ed5ad (diff) |
Fix adding new items
See merge request CarpNet/saucypy!2
-rwxr-xr-x | saucypy | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6,7 +6,7 @@ import optparse import shlex import sys -VERSION = "1.0.3" +VERSION = "1.0.4" ENTRIES_FILE = "saucypy.json" @@ -38,13 +38,13 @@ def main(): if options.add: key, value = options.add - entries[key] = value matches = find( key, entries ) if len( matches ) > 1: exact_match = list(filter( lambda x: x == key, matches)) if exact_match: print ("There is already an item named " + key) else: + entries[key] = value json.dump( entries, open( ENTRIES_FILE, "w" ), indent = 4, sort_keys = True ) print (key + ": " + value + " added") elif options.count: |