diff options
author | Joe Robinson <joe@lc8n.com> | 2020-11-08 16:57:47 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2020-11-08 16:57:47 +0000 |
commit | a63625b6dc75131e60ac8522e441efd79d26932e (patch) | |
tree | f08bda7edf917bd28937eb709d33bec489c67aa3 | |
parent | 28d2655da1b93b5e5ca8e4b9bde87023b73734a5 (diff) | |
parent | 8c1ba91f22696451b12176f52bc0224a85757de6 (diff) |
Merge branch 'master' into 'master'
Fix index searching
See merge request CarpNet/wikiquery!5
-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) |