X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/4644846ee87e7e9eaa30ec40d679d0e02afd8d14..ae90555c01d3aa4495ce2c8e0c73e1eb1eaea77a:/graph diff --git a/graph b/graph index ab51d08..eaafb76 100755 --- a/graph +++ b/graph @@ -17,6 +17,7 @@ GetOptions(\my %opt, 'follow|f:i', 'trim|length|l=i', 'markers|m=s', + 'unmodified|u!', 'width|w=i', 'usage|h' => sub { podexit() }, 'help' => sub { podexit(-verbose => 2) }, @@ -39,7 +40,8 @@ $SIG{INT} = 'IGNORE'; # continue after assumed eof my (@lines, @values); while (readline) { chomp; - push @values, s/^\h* ( -? [0-9]* (?:\.[0-9]+)? )//x && $1; + s/^\h*// unless $opt{unmodified}; + push @values, s/^ ( \h* -? [0-9]* \.? [0-9]+ |)//x && $1; if (defined $opt{trim}) { my $trimpos = abs $opt{trim}; if ($trimpos <= 1) { @@ -183,6 +185,11 @@ or 68% of all entries. =back +=item -u, --unmodified + +Do not strip leading whitespace. +Keep original value alignment, which may be significant in some programs. + =item -w, --width= Override the maximum number of columns to use. @@ -217,7 +224,7 @@ Number of HTTP requests per day: Any kind of database query with leading counts: echo 'SELECT count(*),schemaname FROM pg_tables GROUP BY 2' | - psql -t | graph + psql -t | graph -u Git statistics, such commit count by year: