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