diff options
author | rillig <rillig@pkgsrc.org> | 2020-05-03 08:49:16 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-05-03 08:49:16 +0000 |
commit | f06ea455176c71504fdc0b89cf16522b806c6718 (patch) | |
tree | c6218ccb2c3dcfbdfc74c20d1607cc8472e8e5c2 /mk/help | |
parent | 68c727828e7698b8a7127f49bc99de4d0618ed36 (diff) | |
download | pkgsrc-f06ea455176c71504fdc0b89cf16522b806c6718.tar.gz |
mk/help: only list help topics that have associated keywords
Diffstat (limited to 'mk/help')
-rw-r--r-- | mk/help/help.awk | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk index cefee321afb..90d80ded04e 100644 --- a/mk/help/help.awk +++ b/mk/help/help.awk @@ -1,4 +1,4 @@ -# $NetBSD: help.awk,v 1.35 2020/03/30 06:21:52 rillig Exp $ +# $NetBSD: help.awk,v 1.36 2020/05/03 08:49:16 rillig Exp $ # # This program extracts the inline documentation from *.mk files. @@ -35,7 +35,7 @@ BEGIN { # end of a file or by the end of all files. When there have been enough # comment lines, the topic is considered worth printing. # -function end_of_topic() { +function end_of_topic( relevant, has_keywords) { if (comment_lines <= 2 || ignore_this_section) { if (array_is_empty(keywords)) { @@ -52,7 +52,13 @@ function end_of_topic() { for (k in keywords) all_keywords[k]++; - relevant = (topic in keywords || lctopic in keywords || uctopic in keywords || topic == ":all"); + relevant = no; + if (topic == ":all") + for (k in keywords) + relevant = yes; + if (topic in keywords || lctopic in keywords || uctopic in keywords) + relevant = yes; + if (relevant && !print_index) { if (found_anything) |