1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

nuxsh: Fixed command parsing

This commit is contained in:
Tony Tkáčik 2023-08-24 10:54:40 +02:00
parent d30931c3df
commit 9e2142ea53

View file

@ -85,7 +85,7 @@ nux.use nuxr/repl
local task_dot=$(tr " " "." <<< "$task") local task_dot=$(tr " " "." <<< "$task")
nux.log trace "Trying to figure task documentation location for $task $task_dot" nux.log trace "Trying to figure task documentation location for $task $task_dot"
doc_start=$(grep -hn -E "## +($task)::" "$script" | cut -d: -f1) 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 nux.log trace "doc_start" $doc_start $code_start
if [ -n "$doc_start" -a -n "$code_start" ] { if [ -n "$doc_start" -a -n "$code_start" ] {
sed -n "$doc_start,$code_start"p "$script" \ sed -n "$doc_start,$code_start"p "$script" \