diff options
author | Alasdair Colley <alnessy@hotmail.com> | 2014-07-23 12:01:35 +0200 |
---|---|---|
committer | Alasdair Colley <alnessy@hotmail.com> | 2014-07-23 12:01:35 +0200 |
commit | 7a4ff77f24e42acce8cf57d41e0c71ea8e026dd0 (patch) | |
tree | 087a322b20e012986d645610b7bfe31bf1373a38 | |
parent | 1aff5c70a383ab86c8be0b1fdfd5c8f5c08d27bf (diff) |
now displays an exact match by default
-rwxr-xr-x | saucypy | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6,7 +6,7 @@ import optparse import shlex import sys -VERSION = "1.0.0" +VERSION = "1.0.1" ENTRIES_FILE = "saucypy.json" @@ -50,7 +50,10 @@ def main(): matches = find( args[0], entries ) if len( matches ) > 1: - if options.index is not None: + exact_match = filter( lambda x: x == args[0], matches ) + if exact_match: + print entries[exact_match[0]] + elif options.index is not None: try: print entries[matches[options.index]] except IndexError: @@ -65,4 +68,3 @@ def main(): if __name__ == "__main__": main() - |