diff options
author | Fbenas <philbeansburton@gmail.com> | 2020-11-08 16:40:42 +0000 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2020-11-08 16:40:42 +0000 |
commit | 8c1ba91f22696451b12176f52bc0224a85757de6 (patch) | |
tree | f08bda7edf917bd28937eb709d33bec489c67aa3 | |
parent | 1bbb78e1e164cda9d2ba882653423504069106c3 (diff) |
Fix index searching
-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) |