Minor fixes to reading README.md via daisy_help/daisy_list

This commit is contained in:
Sam Hardeman 2025-11-21 11:56:58 +01:00
parent 3eeb4e2d7f
commit 6f8d3acc39

View file

@ -353,7 +353,7 @@ function daisy_quit_if_no
# Help function, courtesy of Google Gemini # Help function, courtesy of Google Gemini
function daisy_help() { function daisy_help() {
local target_tool="$1" local target_tool="$1"
local file="README.md" # Updated filename local file="$DAISY_FOLDER/README.md"
# 1. Extract the block between the new headers # 1. Extract the block between the new headers
sed -n '/--- BEGIN OF DAISY HELP ---/,/--- END OF DAISY HELP ---/{//!p;}' "$file" | \ sed -n '/--- BEGIN OF DAISY HELP ---/,/--- END OF DAISY HELP ---/{//!p;}' "$file" | \
@ -397,10 +397,10 @@ function daisy_help() {
} }
# Print description lines if we are in a "found" block # Print description lines if we are in a "found" block
printing { printing {
# Stop if we hit the start of the NEXT tool # Stop if we hit the start of the NEXT tool
if ($0 ~ /^[[:space:]]*- /) { printing=0; next } if ($0 ~ /^[[:space:]]*- /) { printing=0; next }
print print
} }
END { END {
@ -414,8 +414,7 @@ function daisy_help() {
# Courtesy of Google Gemini # Courtesy of Google Gemini
daisy_list() { daisy_list() {
local file="README.md" local file="$DAISY_FOLDER/README.md"
echo "Available LACKADAISICAL commands:" echo "Available LACKADAISICAL commands:"
# Extract block -> Find tool lines -> Clean formatting -> Print # Extract block -> Find tool lines -> Clean formatting -> Print