From 9e2142ea530638f9453f28e0dc05012710a06e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Tk=C3=A1=C4=8Dik?= Date: Thu, 24 Aug 2023 10:54:40 +0200 Subject: [PATCH] nuxsh: Fixed command parsing --- inc/nuxr.nuxsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/nuxr.nuxsh.sh b/inc/nuxr.nuxsh.sh index 16ca164..5db6913 100644 --- a/inc/nuxr.nuxsh.sh +++ b/inc/nuxr.nuxsh.sh @@ -85,7 +85,7 @@ nux.use nuxr/repl local task_dot=$(tr " " "." <<< "$task") nux.log trace "Trying to figure task documentation location for $task $task_dot" doc_start=$(grep -hn -E "## +($task)::" "$script" | cut -d: -f1) - code_start=$(grep -hn -E "((@command +:?$task_dot .*)|(function +task.$task_dot)|(task.$task_dot *\(\))) +{" "$script" | cut -d: -f1) + code_start=$(grep -hn -E "((@command +:?$task_dot)|(function +task.$task_dot)|(task.$task_dot *\(\))) +{" "$script" | cut -d: -f1) nux.log trace "doc_start" $doc_start $code_start if [ -n "$doc_start" -a -n "$code_start" ] { sed -n "$doc_start,$code_start"p "$script" \