Skip to content

Commit ff64b9d

Browse files
committed
dev:Improve diff-fail-xxx commands
To pipe by default and support vimo for long diff lines.
1 parent c6e0f91 commit ff64b9d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

devops/manage-statbus.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,21 @@ case "$action" in
346346
# Extract the full test name (e.g., "01_load_web_examples")
347347
test=$(echo "$test_line" | sed -E 's/not ok[[:space:]]+[0-9]+[[:space:]]+- ([^[:space:]]+).*/\1/')
348348

349-
ui_choice=${1:-tui}
349+
ui_choice=${1:-pipe}
350350
line_limit=${2:-}
351351
case $ui_choice in
352352
'gui')
353353
echo "Running opendiff for test: $test"
354354
opendiff $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out -merge $WORKSPACE/test/expected/$test.out
355355
;;
356-
'tui')
357-
echo "Running vimdiff for test: $test"
356+
'vim'|'tui')
357+
echo "Running vim -d for test: $test"
358358
vim -d $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out < /dev/tty
359359
;;
360+
'vimo')
361+
echo "Running vim -d -o for test: $test"
362+
vim -d -o $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out < /dev/tty
363+
;;
360364
'pipe')
361365
echo "Running diff for test: $test"
362366
# Note the pipe from /dev/tty to avoid the diff alias running an interactive program.
@@ -367,7 +371,7 @@ case "$action" in
367371
fi
368372
;;
369373
*)
370-
echo "Error: Unknown UI option '$ui_choice'. Please use 'gui', 'tui', or 'pipe'."
374+
echo "Error: Unknown UI option '$ui_choice'. Please use 'gui', 'vim', 'vimo', or 'pipe'."
371375
exit 1
372376
;;
373377
esac
@@ -381,7 +385,7 @@ case "$action" in
381385
exit 1
382386
fi
383387

384-
ui_choice=${1:-tui} # Get UI choice from the first argument to diff-fail-all, default to tui
388+
ui_choice=${1:-pipe} # Get UI choice from the first argument to diff-fail-all, default to pipe
385389
line_limit=${2:-}
386390

387391
# Use process substitution to avoid running the loop in a subshell,
@@ -406,10 +410,14 @@ case "$action" in
406410
echo "Running opendiff for test: $test"
407411
opendiff $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out -merge $WORKSPACE/test/expected/$test.out
408412
;;
409-
'tui')
410-
echo "Running vimdiff for test: $test"
413+
'vim'|'tui')
414+
echo "Running vim -d for test: $test"
411415
vim -d $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out < /dev/tty
412416
;;
417+
'vimo')
418+
echo "Running vim -d -o for test: $test"
419+
vim -d -o $WORKSPACE/test/expected/$test.out $WORKSPACE/test/results/$test.out < /dev/tty
420+
;;
413421
'pipe')
414422
echo "Running diff for test: $test"
415423
# Note the pipe from /dev/tty to avoid the diff alias running an interactive program.
@@ -420,7 +428,7 @@ case "$action" in
420428
fi
421429
;;
422430
*)
423-
echo "Error: Unknown UI option '$ui_choice'. Please use 'gui', 'tui', or 'pipe'."
431+
echo "Error: Unknown UI option '$ui_choice'. Please use 'gui', 'vim', 'vimo', or 'pipe'."
424432
exit 1
425433
;;
426434
esac

0 commit comments

Comments
 (0)