From b313096745f221e192bd2f69e75260545c2d9c47 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 31 Jan 2023 23:37:30 +0100 Subject: [PATCH] board/common: add '-p' option to help script for plain/noansi output Signed-off-by: Joachim Wiberg --- board/common/rootfs/bin/help | 43 +++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/board/common/rootfs/bin/help b/board/common/rootfs/bin/help index 421924f9..cd673618 100755 --- a/board/common/rootfs/bin/help +++ b/board/common/rootfs/bin/help @@ -7,6 +7,17 @@ IT=$(printf '\033[3m') BL=$(printf '\033[5m') H0=$(printf '\033[0m') +noansi() +{ + H1="" + H2="" + DM="" + UL="" + IT="" + BL="" + H0="" +} + overview() { cat <"$fn" - if command -v most; then - most "$fn" - elif command -v less; then - less -R "$fn" - elif command -v more; then - more "$fn" - else - cat "$fn" - fi + # shellcheck disable=SC2086,SC2068 + topic $@ >"$fn" + $pager "$fn" rm "$fn" else - topic $* + topic "$*" fi