diff options
Diffstat (limited to 'wikiquery')
-rwxr-xr-x | wikiquery | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -86,10 +86,14 @@ def main(): if args: topic = args.pop(0) - while len(args) > 0 and not(isinstance(args[0], (int))): + while len(args) > 0 and not(args[0].isdigit()): topic += " " + args.pop(0) - index = int(args.pop(0)) if args else None + index = int(args.pop(0)) -1 if args else None + + if index < 1: + print ("Cannot search for index < 1") + sys.exit(0) if options.search: search(topic, index) |