code/commands
This commit is contained in:
parent
51cb88d0d3
commit
cc1f8f816a
2 changed files with 21 additions and 2 deletions
10
sh/code.awk
10
sh/code.awk
|
@ -32,6 +32,7 @@ BEGIN {
|
|||
|
||||
RE_ALIAS = RE_BEGIN "#=" RE_SPACES RE_VAR RE_END
|
||||
RE_CLOSE = RE_BEGIN "}" RE_SPACES RE_END
|
||||
RE_COMMAND = RE_BEGIN "#/" RE_SPACES RE_VAR RE_END
|
||||
RE_CONSTANT = RE_BEGIN RE_CONST RE_SET RE_END
|
||||
RE_DOC = RE_BEGIN RE_SPACES "#" RE_SPACE RE_ANY RE_END
|
||||
RE_FUNCTION = RE_BEGIN RE_VAR RE_FUNC RE_END
|
||||
|
@ -50,6 +51,10 @@ BEGIN {
|
|||
if (match($0, RE_ALIAS, m)) {
|
||||
print m[1]
|
||||
}
|
||||
} else if (action == "commands") {
|
||||
if (match($0, RE_COMMAND, m)) {
|
||||
print m[1]
|
||||
}
|
||||
} else if (action == "constants") {
|
||||
if (match($0, RE_CONSTANT, m)) {
|
||||
print m[1]
|
||||
|
@ -89,6 +94,11 @@ BEGIN {
|
|||
if (m[1] == target) {
|
||||
alias = 1
|
||||
}
|
||||
} else if (match($0, RE_COMMAND, m)) {
|
||||
append("/ " m[1])
|
||||
if (m[1] == target) {
|
||||
alias = 1
|
||||
}
|
||||
# set
|
||||
} else if (match($0, RE_CONSTANT, m)) {
|
||||
if (m[1] == target) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue