Compare commits
7 commits
2f7dd63c74
...
4151928013
Author | SHA1 | Date | |
---|---|---|---|
4151928013 | |||
16b772c8d9 | |||
ec8b414018 | |||
6130f15fec | |||
3e07b468d1 | |||
297b3a3385 | |||
e4687e788b |
5 changed files with 31 additions and 7 deletions
|
@ -117,6 +117,6 @@ Two interpreted languages for flexibility.
|
|||
* get unresolved path for new panes & windows
|
||||
* fully working doc function algorithm
|
||||
* self install aliases
|
||||
* list aliases
|
||||
* transfer all parsings to awk
|
||||
|
||||
### 6.2 [Further tasks](#when) {#when-further}
|
||||
|
|
|
@ -46,7 +46,11 @@ BEGIN {
|
|||
}
|
||||
|
||||
{
|
||||
if (action == "alias") {
|
||||
if (action == "aliases") {
|
||||
if (match($0, RE_ALIAS, m)) {
|
||||
print m[1]
|
||||
}
|
||||
} else if (action == "aliases functions") {
|
||||
if (match($0, RE_ALIAS, m)) {
|
||||
append(m[1])
|
||||
} else if (match($0, RE_FUNCTION, m)) {
|
||||
|
|
13
sh/code.sh
13
sh/code.sh
|
@ -19,12 +19,23 @@ rwx_code() {
|
|||
echo "${_rwx_code}"
|
||||
}
|
||||
|
||||
# show the cached aliases
|
||||
#= rca
|
||||
rwx_code_aliases() {
|
||||
echo "${_rwx_code_aliases}"
|
||||
}
|
||||
|
||||
# show the cached aliases and functions
|
||||
#= rcaf
|
||||
rwx_code_aliases_functions() {
|
||||
echo "${_rwx_code_aliases_functions}"
|
||||
}
|
||||
|
||||
# show the cached awk script
|
||||
rwx_code_awk() {
|
||||
echo "${_rwx_code_awk}"
|
||||
}
|
||||
|
||||
# show the cached constants
|
||||
#= rcc
|
||||
rwx_code_constants() {
|
||||
|
@ -66,5 +77,5 @@ rwx_code_doc() {
|
|||
awk \
|
||||
--assign action="doc" \
|
||||
--assign target="${name}" \
|
||||
"${_rwx_code_awk}"
|
||||
"$(rwx_code_awk)"
|
||||
}
|
||||
|
|
14
sh/main.sh
14
sh/main.sh
|
@ -202,7 +202,9 @@ ${RWX_REGEX_BEGIN}\\(${RWX_REGEX_VARIABLE}\\)${RWX_REGEX_SET}"
|
|||
_rwx_code_variables=""
|
||||
|
||||
rwx_parse_code() {
|
||||
# parse aliases commands
|
||||
# parse aliases
|
||||
_rwx_code_aliases="$(rwx_parse_aliases)"
|
||||
# parse aliases functions
|
||||
local line text
|
||||
_rwx_code_aliases_functions="$(rwx_parse_aliases_functions)"
|
||||
while IFS= read -r line; do
|
||||
|
@ -219,11 +221,17 @@ EOF
|
|||
# parse variables
|
||||
_rwx_code_variables="$(rwx_parse_variables)"
|
||||
}
|
||||
rwx_parse_aliases() {
|
||||
echo "${_rwx_code}" |
|
||||
awk \
|
||||
--assign action="aliases" \
|
||||
"$(rwx_code_awk)"
|
||||
}
|
||||
rwx_parse_aliases_functions() {
|
||||
printf "%s" "${_rwx_code}" |
|
||||
awk \
|
||||
--assign action="alias" \
|
||||
"${_rwx_code_awk}"
|
||||
--assign action="aliases functions" \
|
||||
"$(rwx_code_awk)"
|
||||
}
|
||||
rwx_parse_constants() {
|
||||
printf "%s" "${_rwx_code}" |
|
||||
|
|
|
@ -16,11 +16,12 @@ rwx_test() {
|
|||
rwx_test_code() {
|
||||
local items
|
||||
set \
|
||||
"awk" \
|
||||
"constants" \
|
||||
"variables" \
|
||||
"functions" \
|
||||
"aliases_functions" \
|
||||
"aliases" \
|
||||
"aliases_functions" \
|
||||
|
||||
rwx_code
|
||||
for items in "${@}"; do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue