summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwikiquery6
1 files changed, 5 insertions, 1 deletions
diff --git a/wikiquery b/wikiquery
index 388b2f7..0597cd9 100755
--- a/wikiquery
+++ b/wikiquery
@@ -24,7 +24,11 @@ def main():
sys.exit(0)
if args.search:
- print wikipedia.search(args.topic)
+ results = wikipedia.search(args.topic)
+ if len(results) == 1:
+ print wikipedia.summary(results[0])
+ else:
+ print results
elif args.url:
page = wikipedia.page(args.topic)
print page.url