Skip to content

Commit d470451

Browse files
committed
doc: fix t0450-txt-doc-vs-help to select only first synopsis block
In case there are multiple synopsis blocks (declared with [synopsis] or [verse] style) in the same file, the previous implementation was incorrectly picking up text from all the blocks until the first empty line. This commit modifies the sed command to stop processing upon encountering the first empty line after the first block declaration, thereby ensuring that only the intended block is captured. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent c4a0c88 commit d470451

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t0450-txt-doc-vs-help.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ adoc_to_synopsis () {
5656
b2t="$(builtin_to_adoc "$builtin")" &&
5757
sed -n \
5858
-E '/^\[(verse|synopsis)\]$/,/^$/ {
59-
/^$/d;
59+
/^$/q;
6060
/^\[(verse|synopsis)\]$/d;
6161
s/\{litdd\}/--/g;
6262
s/'\''(git[ a-z-]*)'\''/\1/g;

0 commit comments

Comments
 (0)