Add new "screenshots".
[paraslash.git] / command_util.sh
index 62a406c72778bf10cd7f7889b288a9a786448a7f..f0a861d61d887b5e68b9e90e9b9cfa512c23b9b6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 
 read_header()
@@ -161,7 +161,7 @@ dump_man()
                echo ".fi"
        fi
        echo
-       echo "$help_txt"
+       echo "$help_txt" | sed -e 's/^  //'
        echo
        if test -n "$perms_txt"; then
                echo -n "\\fBpermissions:\\fP "
@@ -241,7 +241,7 @@ dump_array_member()
        echo ".description = \"$desc_txt\","
        echo ".usage = \"$usage_txt\","
        echo ".help = "
-       echo "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g'
+       printf "%s\n" "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g'
        echo '},'
 }
 
@@ -263,7 +263,7 @@ template_loop()
                perms_txt=$(echo $t_perms | $sed_cmd)
                desc_txt=$(echo $t_desc | $sed_cmd)
                usage_txt=$(echo $t_usage | $sed_cmd)
-               help_txt=$(echo $t_help | $sed_cmd)
+               help_txt=$(printf "%s" "$t_help" | $sed_cmd)
                prototype=$(echo "$template_prototype" | $sed_cmd)
                $1
        done