From: Daniel Stenberg Date: Tue, 5 Mar 2024 16:32:00 +0000 (+0100) Subject: mkhelp: simplify the generated hugehelp program X-Git-Tag: curl-8_7_0~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62c08d5d4a14578ce29684104160e643f64480b4;p=thirdparty%2Fcurl.git 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 --- 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; + if(!$n) { + $blank++; + } + else { + $n =~ s/ /\\t/g; + printf(" \"%s%s\",\n", $blank?"\\n":"", $n); + $blank = 0; } - printf("\"%s\\n\"\n", $new); - } -print ", stdout) ;\n}\n"; +print <