mawk/shebang
This commit is contained in:
parent
596126bb85
commit
8beb437ce0
1 changed files with 5 additions and 2 deletions
|
@ -28,6 +28,9 @@ function extract(string, type) {
|
|||
} else if (type == "module") {
|
||||
split(string, array, "#\\.")
|
||||
return trim(array[2])
|
||||
} else if (type == "shebang") {
|
||||
split(string, array, "#!")
|
||||
return trim(array[2])
|
||||
} else if ((type == "constant") || (type == "variable")) {
|
||||
split(string, array, "=")
|
||||
return trim(array[1])
|
||||
|
@ -152,8 +155,8 @@ BEGIN {
|
|||
}
|
||||
} else if (action == "doc") {
|
||||
# doc
|
||||
if (match($0, RE_SHEBANG, m)) {
|
||||
append("! " m[1])
|
||||
if (match($0, RE_SHEBANG)) {
|
||||
append("! " extract($0, "shebang"))
|
||||
} else if (match($0, RE_DOC, m)) {
|
||||
if (f) {
|
||||
append($0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue