]> git.tue.mpg.de Git - gsu.git/commitdiff
gsu: Print help text on prefs command.
authorAndre Noll <maan@systemlinux.org>
Tue, 2 Mar 2010 14:56:50 +0000 (15:56 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:36:07 +0000 (21:36 +0200)
This uses another nice bashism I recently learned.

funcs/gsu

index 043676c4b303ae4dc8e49160bfa11bc066f8ac2b..add1be4a4567b759df60edb93e9aa658fdb1c239 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -163,6 +163,7 @@ com_prefs()
                        printf " [$default_value]"
                fi
                echo
+               [[ -n "$help_text" ]] && sed -e '/^[    ]*$/d; s/^[     ]*/#    /g' <<< "$help_text"
                printf "$name=$val"
                [[ "$val" == "$default_value" ]] && printf " # default"
                echo