From 62c08d5d4a14578ce29684104160e643f64480b4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 5 Mar 2024 17:32:00 +0100 Subject: [PATCH] mkhelp: simplify the generated hugehelp program Use a plain array and puts() every line, also allows us to provide the strings without ending newlines. - merge blank lines into the next one as a prefixed newline. - turn eight consecutive spaces into a tab (since they can only be on the left side of text) - the newly generated tool_hugehelp is 3K lines shorter and 50K smaller - modifies the top logo layout a little by reducing the indent Closes #13047 --- src/mkhelp.pl | 67 +++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/mkhelp.pl b/src/mkhelp.pl index 5429160716..f1e1de1c66 100755 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -35,11 +35,11 @@ if($ARGV[0] eq "-c") { shift @ARGV; } -push @out, " _ _ ____ _\n"; -push @out, " Project ___| | | | _ \\| |\n"; -push @out, " / __| | | | |_) | |\n"; -push @out, " | (__| |_| | _ <| |___\n"; -push @out, " \\___|\\___/|_| \\_\\_____|\n"; +push @out, " _ _ ____ _\n"; +push @out, " ___| | | | _ \\| |\n"; +push @out, " / __| | | | |_) | |\n"; +push @out, " | (__| |_| | _ <| |___\n"; +push @out, " \\___|\\___/|_| \\_\\_____|\n"; my $olen=0; while () { @@ -157,40 +157,43 @@ exit; } else { print < 500) { - # terminate and make another fputs() call here - print ", stdout);\n fputs(\n"; - $outsize=length($new)+1; - } - printf("\"%s\\n\"\n", $new); - -} - -print ", stdout) ;\n}\n"; +ENDLINE + ; foot(); sub foot { - print <