summaryrefslogtreecommitdiff
path: root/mk/help
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-08-14 18:04:16 +0000
committerrillig <rillig@pkgsrc.org>2007-08-14 18:04:16 +0000
commit6f1d6ed16446cb6e62b04cd25d7234a38705d982 (patch)
tree952903b98ad28f8c6e5056d455e7b34436856c16 /mk/help
parent6af03c047d919623a1c89d8842f71be8606bfb69 (diff)
downloadpkgsrc-6f1d6ed16446cb6e62b04cd25d7234a38705d982.tar.gz
Return the documentation for FOO.<param> or FOO.${param} when help for
FOO is requested.
Diffstat (limited to 'mk/help')
-rw-r--r--mk/help/help.awk11
1 files changed, 8 insertions, 3 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk
index 3a9460e22cc..465cc3bd866 100644
--- a/mk/help/help.awk
+++ b/mk/help/help.awk
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.15 2007/06/04 08:11:07 rillig Exp $
+# $NetBSD: help.awk,v 1.16 2007/08/14 18:04:16 rillig Exp $
#
# This program extracts the inline documentation from *.mk files.
@@ -99,8 +99,13 @@ $1 ~ /:$/ && $2 == ".PHONY" {
# Everything else is assumed to belong to the explaining text.
#
NF >= 1 {
- w1 = ($1 == tolower($1)) ? toupper($1) : $1;
- w2 = ($2 == tolower($2)) ? toupper($2) : $2;
+ # Reduce FOO.<param> and FOO.${param} to FOO.
+ w1 = gensub(/\.[<$].*[>}]$/, "", "g", $1);
+ w2 = gensub(/\.[<$].*[>}]$/, "", "g", $2);
+
+ # Convert all-lowercase words to all-uppercase.
+ w1 = (w1 == tolower(w1)) ? toupper(w1) : w1;
+ w2 = (w2 == tolower(w2)) ? toupper(w2) : w2;
this_line_is_definition = (w1 == toupper($1)) && (w2 == toupper($2));