From 8d8042fefe9b188fa8c4510b61469125b2a12f49 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 11 Jul 2025 15:49:23 +0200 Subject: [PATCH] tasks/fixme,todo --- sh/core/code.awk | 8 +++++++- sh/core/code.sh | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/sh/core/code.awk b/sh/core/code.awk index aa9ad51..78aa6b7 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -82,7 +82,13 @@ BEGIN { match_task = 0 output_module = ". " m[1] } else if (match($0, RE_TASK, m)) { - match_task = 1 + if (target) { + if (target == m[1]) { + match_task = 1 + } + } else { + match_task = 1 + } append($0) } else if (match($0, RE_COMMENT, m)) { append($0) diff --git a/sh/core/code.sh b/sh/core/code.sh index ed3e21b..4c12e49 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -36,6 +36,8 @@ _rwx_code_constants="" _rwx_code_functions="" # cache for code tasks _rwx_code_tasks="" +_rwx_code_tasks_fixme="" +_rwx_code_tasks_todo="" # cache for code variables _rwx_code_variables="" @@ -195,6 +197,18 @@ rwx_code_tasks() { echo "${_rwx_code_tasks}" } +# show the cached fixme tasks +#= rctf +rwx_code_tasks_fixme() { + echo "${_rwx_code_tasks_fixme}" +} + +# show the cached todo tasks +#= rctt +rwx_code_tasks_todo() { + echo "${_rwx_code_tasks_todo}" +} + # show the cached variables #= rcv rwx_code_variables() { @@ -255,6 +269,8 @@ EOF _rwx_code_functions="$(rwx_code_action_target "filter" "function")" # parse tasks _rwx_code_tasks="$(rwx_code_action_target "tasks")" + _rwx_code_tasks_fixme="$(rwx_code_action_target "tasks" "FIXME")" + _rwx_code_tasks_todo="$(rwx_code_action_target "tasks" "TODO")" # parse variables _rwx_code_variables="$(rwx_code_action_target "filter" "variable")" }