diff options
author | rillig <rillig> | 2007-08-14 18:04:16 +0000 |
---|---|---|
committer | rillig <rillig> | 2007-08-14 18:04:16 +0000 |
commit | 22e5492f78d2b8539d245c41a79b807218b0e66b (patch) | |
tree | 952903b98ad28f8c6e5056d455e7b34436856c16 /mk | |
parent | 0a197435572bf59ab6da7769cefbb623944538e5 (diff) | |
download | pkgsrc-22e5492f78d2b8539d245c41a79b807218b0e66b.tar.gz |
Return the documentation for FOO.<param> or FOO.${param} when help for
FOO is requested.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/help/help.awk | 11 |
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)); |