From c9400ac46f800b47ea0b3149b3d5344df0fbea3e Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 17 Nov 2021 07:38:53 +0000 Subject: [PATCH] Fix recognition of command without optional parts --- ia-cdx-search | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ia-cdx-search b/ia-cdx-search index 3d023e8..61684f1 100755 --- a/ia-cdx-search +++ b/ia-cdx-search @@ -72,7 +72,7 @@ async def main(query, concurrency = 1, startPage = None, numPages = None): args = sys.argv[1:] -if len(args) not in (2, 3, 4) or args[0].lower() in ('-h', '--help') or re.search(r'(^|&)(output|limit|resumekey|showresumekey|page|shownumpages)=', args[0], re.IGNORECASE): +if not 1 <= len(args) <= 4 or args[0].lower() in ('-h', '--help') or re.search(r'(^|&)(output|limit|resumekey|showresumekey|page|shownumpages)=', args[0], re.IGNORECASE): print('Usage: ia-cdx-search QUERY [CONCURRENCY] [PAGE NUMPAGES]', file = sys.stderr) print('Please refer to https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server for the relevant query parameters', file = sys.stderr) print('The output, limit, resumeKey, showResumeKey, page, and showNumPages parameters must not be included.', file = sys.stderr)