diff options
-rwxr-xr-x | saucypy | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -20,6 +20,7 @@ def parse_args(): parser = optparse.OptionParser( usage = "!source <term> | !source --add <key> <value>" ) parser.add_option( "-a", "--add", action = "store", nargs = 2 ) parser.add_option( "-i", "--index", action = "store", type = int ) + parser.add_option( "-c", "--count", action = "store_true" ) parser.add_option( "-v", "--version", action = "store_true" ) return parser.parse_args( args ) @@ -40,6 +41,8 @@ def main(): entries[key] = value json.dump( entries, open( ENTRIES_FILE, "w" ), indent = 4, sort_keys = True ) + elif options.count: + print "Entries: {0}".format( len( entries.keys() ) ) else: if not args: print "Expected a search argument, got nothing." |