User:David/Cvar Matrix

Introduction
As with the Imported Cvars automation was used to generate the Cvar Matrix. This is here to document how that was done so it can be repeated if needed. Flag A (Archive) is deliberately left off as almost all cvars have it set.

Steps

 * Get a list of cvars.
 * See step 1 over at User:David/Imported Cvars.
 * Run script.
 * Source is below.
 * It wants the cvar list on stdin.
 * Spews all output to stdout.
 * Check it!
 * Again, don't blame me when it all goes horribly wrong.
 * Copy and paste it where you want it.
 * The generated output has no header, or other surrounding table stuffs.

The Script
use strict;
 * 1) !/usr/bin/perl -W

sub trunc {	my ($str) = @_; if (length($str) > 20) {		return (substr($str, 0, 17) . "..."); }	return ($str); }

while(my $line = ) {	if ($line =~ /^(.)(.)(.)(.)(.)(.)(.) ([^ ]+) "([^"]*)"$/)	{		# SURIALC		# S=serverinfo		# U=userinfo		# R=readonly		# I=initilisation only or something.		# A=archive		# L=latched		# C=cheat		print "|-\n";		print "| $8 || " . ($9 eq "" ? "None" : trunc($9)) . " || || ";		print $1 eq "S" ? "Yes" : "No";		print " || ";		print $2 eq "U" ? "Yes" : "No";		print " || ";		print $3 eq "R" ? "Yes" : "No";		print " || ";		print $4 eq "I" ? "Yes" : "No";		print " || ";		print $5 eq "A" ? "Yes" : "No";		print " || ";		print $6 eq "L" ? "Yes" : "No";		print " || ";		print $7 eq "C" ? "Yes" : "No";		print "\n";	}	else	{		print STDERR "Unable to parse line: " . $line;	} }