diff options
Diffstat (limited to 'tools/make-manuf')
-rwxr-xr-x | tools/make-manuf | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/make-manuf b/tools/make-manuf index 081dc2ba27..37fd9c89f1 100755 --- a/tools/make-manuf +++ b/tools/make-manuf @@ -24,6 +24,7 @@ use Encode; use open ':encoding(utf8)'; +use Text::Autoformat; eval "require LWP::UserAgent;"; if( $@ ) { @@ -91,7 +92,16 @@ sub shorten if ($manuf =~ /\Q$origmanuf\E/i) { return $manuf; } else { - return sprintf("%-22s # %s", $manuf, $origmanuf); + my $mixedcase = $origmanuf; + + #If company is all caps, convert to mixed case (so it doesn't look like we're screaming the company name) + if ($origmanuf =~ /^[A-Z\s\.\,]+$/) { + $mixedcase = autoformat $origmanuf, { case => 'title' }; + #autoformat produces some unnecessary linebreaks + chomp($mixedcase); + chomp($mixedcase); + } + return sprintf("%s\t%s", $manuf, $mixedcase); } } |