]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command_util.sh
command_util: Output array members with backslashes.
[paraslash.git] / command_util.sh
index b3b8804c28f4bce50398ebdde5d4c32809a05bc4..875b5e6957f7509a15352cdfc6a9c7239402a448 100755 (executable)
@@ -206,24 +206,18 @@ make_proto()
 
 make_array_member()
 {
-       local TAB='     '
+       local TAB='     ' CR='
+'
        local tmp
 
-       result="
-       {
-       .name = \"$name_txt\",
-       .handler = com_$name_txt,
-       "
+       result="{.name = \"$name_txt\", .handler = com_$name_txt, "
        if test -n "$perms_txt"; then
                result="$result .perms = $perms_txt,"
        fi
-       result="$result
-       .description = \"$desc_txt\",
-       .usage = \"$usage_txt\",
-       .help = "
+       result="$result.description = \"$desc_txt\", .usage = \"$usage_txt\", \\$CR .help = "
        tmp="$(printf "%s\n" "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g' \
-               -e "s/$TAB/\\\t/g")"
-       result="$result $tmp },"
+               -e "s/$TAB/\\\t/g" -e's/$/\\/g')"
+       result="$result$tmp$CR}, \\$CR"
 }
 
 make_completion()