summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair Colley <alnessy@hotmail.com>2014-07-23 12:01:35 +0200
committerAlasdair Colley <alnessy@hotmail.com>2014-07-23 12:01:35 +0200
commit7a4ff77f24e42acce8cf57d41e0c71ea8e026dd0 (patch)
tree087a322b20e012986d645610b7bfe31bf1373a38
parent1aff5c70a383ab86c8be0b1fdfd5c8f5c08d27bf (diff)
now displays an exact match by default
-rwxr-xr-xsaucypy8
1 files changed, 5 insertions, 3 deletions
diff --git a/saucypy b/saucypy
index 5f9c9b7..acc7cab 100755
--- a/saucypy
+++ b/saucypy
@@ -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()
-