tasks/simple
This commit is contained in:
parent
9823f99e7c
commit
c03f0792d8
3 changed files with 20 additions and 1 deletions
|
@ -28,6 +28,7 @@ BEGIN {
|
||||||
RE_CONST = "([_A-Z][_0-9A-Z]*)"
|
RE_CONST = "([_A-Z][_0-9A-Z]*)"
|
||||||
RE_SET = "=.*"
|
RE_SET = "=.*"
|
||||||
RE_SPACE = "[[:space:]]"
|
RE_SPACE = "[[:space:]]"
|
||||||
|
RE_TSK = "(FIXME|TODO)"
|
||||||
RE_VAR = "([_a-z][_0-9a-z]*)"
|
RE_VAR = "([_a-z][_0-9a-z]*)"
|
||||||
|
|
||||||
RE_SPACES = RE_SPACE "*"
|
RE_SPACES = RE_SPACE "*"
|
||||||
|
@ -42,8 +43,9 @@ BEGIN {
|
||||||
RE_CONSTANT = RE_BEGIN RE_CONST RE_SET 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_DOC = RE_BEGIN RE_SPACES "#" RE_SPACE RE_ANY RE_END
|
||||||
RE_FUNCTION = RE_BEGIN RE_VAR RE_FUNC RE_END
|
RE_FUNCTION = RE_BEGIN RE_VAR RE_FUNC RE_END
|
||||||
RE_MODULE = RE_BEGIN "#." RE_SPACES RE_ANY RE_END
|
RE_MODULE = RE_BEGIN "#\\." RE_SPACES RE_ANY RE_END
|
||||||
RE_SHEBANG = RE_BEGIN "#!" RE_SPACES RE_ANY RE_END
|
RE_SHEBANG = RE_BEGIN "#!" RE_SPACES RE_ANY RE_END
|
||||||
|
RE_TASK = RE_BEGIN RE_SPACES "#" RE_SPACES RE_TSK RE_ANY RE_END
|
||||||
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END
|
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END
|
||||||
|
|
||||||
f = ""
|
f = ""
|
||||||
|
@ -74,6 +76,12 @@ BEGIN {
|
||||||
if (match($0, RE_FUNCTION, m)) {
|
if (match($0, RE_FUNCTION, m)) {
|
||||||
print m[1]
|
print m[1]
|
||||||
}
|
}
|
||||||
|
} else if (action == "tasks") {
|
||||||
|
if (match($0, RE_MODULE, m)) {
|
||||||
|
print ". " m[1]
|
||||||
|
} else if (match($0, RE_TASK, m)) {
|
||||||
|
print $0
|
||||||
|
}
|
||||||
} else if (action == "variables") {
|
} else if (action == "variables") {
|
||||||
if (match($0, RE_VARIABLE, m)) {
|
if (match($0, RE_VARIABLE, m)) {
|
||||||
print m[1]
|
print m[1]
|
||||||
|
|
|
@ -34,6 +34,8 @@ _rwx_code_commands_functions=""
|
||||||
_rwx_code_constants=""
|
_rwx_code_constants=""
|
||||||
# cache for code functions
|
# cache for code functions
|
||||||
_rwx_code_functions=""
|
_rwx_code_functions=""
|
||||||
|
# cache for code tasks
|
||||||
|
_rwx_code_tasks=""
|
||||||
# cache for code variables
|
# cache for code variables
|
||||||
_rwx_code_variables=""
|
_rwx_code_variables=""
|
||||||
|
|
||||||
|
@ -175,6 +177,12 @@ rwx_code_modules_user() {
|
||||||
echo "${rwx_code_modules_user}"
|
echo "${rwx_code_modules_user}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show the cached tasks
|
||||||
|
#= rct
|
||||||
|
rwx_code_tasks() {
|
||||||
|
echo "${_rwx_code_tasks}"
|
||||||
|
}
|
||||||
|
|
||||||
# show the cached variables
|
# show the cached variables
|
||||||
#= rcv
|
#= rcv
|
||||||
rwx_code_variables() {
|
rwx_code_variables() {
|
||||||
|
@ -233,6 +241,8 @@ EOF
|
||||||
_rwx_code_constants="$(rwx_code_parse "constants")"
|
_rwx_code_constants="$(rwx_code_parse "constants")"
|
||||||
# parse functions
|
# parse functions
|
||||||
_rwx_code_functions="$(rwx_code_parse "functions")"
|
_rwx_code_functions="$(rwx_code_parse "functions")"
|
||||||
|
# parse tasks
|
||||||
|
_rwx_code_tasks="$(rwx_code_parse "tasks")"
|
||||||
# parse variables
|
# parse variables
|
||||||
_rwx_code_variables="$(rwx_code_parse "variables")"
|
_rwx_code_variables="$(rwx_code_parse "variables")"
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ rwx_main_path="${rwx_main_root}/${rwx_main_file}"
|
||||||
# │ main │ find │
|
# │ main │ find │
|
||||||
# ╰──────┴──────╯
|
# ╰──────┴──────╯
|
||||||
|
|
||||||
|
# FIXME separate in two functions
|
||||||
# find root directory shell modules
|
# find root directory shell modules
|
||||||
#| find
|
#| find
|
||||||
#| sed
|
#| sed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue