diff options
| -rw-r--r-- | tests/wallp.bats | 20 | ||||
| -rwxr-xr-x | wallp | 16 |
2 files changed, 35 insertions, 1 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats index e809c13..b78dc35 100644 --- a/tests/wallp.bats +++ b/tests/wallp.bats @@ -278,6 +278,26 @@ EOF [[ "$output" == *"Usage"* ]] } +@test "stdout help has no pango markup tags" { + unset WAYLAND_DISPLAY + run show_help + [[ "$output" != *"<b>"* ]] + [[ "$output" != *"<tt>"* ]] + [[ "$output" == *"Usage"* ]] +} + +@test "qarma help uses pango markup" { + export WAYLAND_DISPLAY="wayland-0" + cat > "$STUB_DIR/qarma" <<EOF +#!/bin/bash +echo "qarma \$*" >> "$TMP_HOME/calls.log" +exit 0 +EOF + chmod +x "$STUB_DIR/qarma" + show_help + grep -q "<b>" "$HOME/calls.log" +} + @test "bootstrap on missing conf exits zero without setting wallpaper" { unset WAYLAND_DISPLAY run main --restore @@ -260,7 +260,21 @@ Usage: Config: ~/.config/wallp/wallp.conf" if [ -n "${WAYLAND_DISPLAY:-}" ] && command -v qarma >/dev/null 2>&1; then - qarma --info --title="wallp help" --text="$text" 2>/dev/null + # qarma renders Pango markup in --info: bold headers, monospace commands. + local markup="<b>wallp</b> — unified wallpaper manager + +<b>Usage</b> + <tt>wallp </tt> Show this help + <tt>wallp --help | -h </tt> Show this help + <tt>wallp --set </tt> Interactive (qarma) selection + <tt>wallp --set H=<file> </tt> Set horizontal screen only + <tt>wallp --set V=<file> </tt> Set vertical screen only + <tt>wallp --set H=<f> V=<f> </tt> Set both screens + <tt>wallp --restore </tt> Restore last session (defaults if none) + <tt>wallp --theme <name> </tt> Override theme (with --set or --restore) + +<b>Config:</b> <tt>~/.config/wallp/wallp.conf</tt>" + qarma --info --title="wallp help" --text="$markup" 2>/dev/null else printf '%s\n' "$text" fi |
