diff options
author | Joe Robinson <joe@lc8n.com> | 2020-11-12 23:59:58 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2020-11-12 23:59:58 +0000 |
commit | 258d73315c14ac8bb64cc5f71350e392b97dbaf8 (patch) | |
tree | 9bf9c411677aac8d03cba6cb8857b6e4672f468e | |
parent | a63625b6dc75131e60ac8522e441efd79d26932e (diff) | |
parent | 6aa1ba47a2f02d64d7b8b1d332a402956fc18cee (diff) |
Remove check for negative index as it's already handled from the parser of args
See merge request CarpNet/wikiquery!6
-rwxr-xr-x | wikiquery | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -12,7 +12,7 @@ version = "0.1.7" def stringify(o): if isinstance(o, list): output = [] - for i, item in enumerate(o, 1): + for i, item in enumerate(o, 0): output.append("%s: %s" % (i, item)) return ' %s' % ', '.join(output) @@ -89,11 +89,7 @@ def main(): while len(args) > 0 and not(args[0].isdigit()): topic += " " + args.pop(0) - index = int(args.pop(0)) -1 if args else None - - if index < 1: - print ("Cannot search for index < 1") - sys.exit(0) + index = int(args.pop(0)) if args else None if options.search: search(topic, index) |