From 6e53648846b3c970c837c640330dc0792da9e3cd Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Wed, 21 Jun 2023 14:47:57 +0200 Subject: check-new-issues: use ' ' syntax --- bin/check-new-issues | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'bin') diff --git a/bin/check-new-issues b/bin/check-new-issues index c9c888ba48..320fe80d19 100755 --- a/bin/check-new-issues +++ b/bin/check-new-issues @@ -286,16 +286,16 @@ def print_stats(): def print_commands(): print(''' * s to skip to next issue - * .h to repeat this help output of the list of commands - * .fname to do "apt-file search name" - * .cname to do "apt-cache search name" - * .wname to look up name in wnpp - * .mpackage to search data/embedded-code-copies for "package" - * .rpackage to launch an editor with a report of the issue against "package" - * .gissue to go to the given issue, even if it's not a todo + * h to repeat this help output of the list of commands + * f name to do "apt-file search name" + * c name to do "apt-cache search name" + * w name to look up name in wnpp + * m package to search data/embedded-code-copies for "package" + * r package to launch an editor with a report of the issue against "package" + * g issue to go to the given issue, even if it's not a todo * d to display the issue information again - * !command to execute a command with system() without any escaping * v or e to launch an editor with the current item + * !command to execute a command * - package-entry to add an entry for "package" and launch an editor (e.g. - poppler ) * n to mark the issue as NOT-FOR-US: * q to save and quit @@ -591,32 +591,32 @@ def present_issue(name): elif m := re.match(r"^s$", line): # skip command break - elif m := re.match(r"^\.c(.*)$", line): + elif m := re.match(r"^c\s+(.*)$", line): s = m.group(1).strip() #$s =~ tr{a-zA-Z0-9_@-}{ }cs; print(f"=== apt-cache search {s}") subprocess.run(f"apt-cache search {s} | less -FX", shell=True) print("===") continue - elif m := re.match(r"^\.f(.*)$", line): + elif m := re.match(r"^f\s+(.*)$", line): s = m.group(1).strip() #s = quotemeta(s) print(f"=== apt-file search {s}") subprocess.run(f"apt-file search {s} | less -FX", shell=True) print("===") continue - elif m := re.match(r"^\.w(.*)$", line): + elif m := re.match(r"^w\s+(.*)$", line): s = m.group(1).strip() print(f"=== wnpp lookup for '{s}':") search_wnpp(s) print("===") continue - elif m := re.match(r'^\.m(.*)$', line): + elif m := re.match(r'^m\s+(.*)$', line): s = m.group(1).strip() print(f"references to {s} in embedded-code-copies:") search_embed(s) or print("none") continue - elif m := re.match(r"^\.g(.+)$", line): + elif m := re.match(r"^g\s+(.+)$", line): n = m.group(1).strip() if n not in cves: print(f"unknown issue '{n}'") @@ -627,7 +627,7 @@ def present_issue(name): break print(f"back at {name} (you might want to type 'd')") continue - elif re.match("^\.h$", line): + elif re.match("^h$", line): print_commands() continue elif m := re.match(r"^!(.+)$", line): @@ -669,7 +669,7 @@ def present_issue(name): print("New entry set to:") print_cve(new_entry) break - elif m := re.match(f'^\.r(.*)$', line): + elif m := re.match(f'^r\s+(.*)$', line): pkg = m.group(1).strip() _, tmpname = tempfile.mkstemp() subprocess.run(f"bin/report-vuln {pkg} {name} > {tmpname}", shell=True) @@ -687,7 +687,7 @@ def present_issue(name): return quit -completion_commands = ".f .c .w .m .r .g ! v e - .help n s q d".split() +completion_commands = "f c w m r g ! v e - h n s q d".split() def complete_line(text, state): response = None -- cgit v1.2.3