From b55e33f4bc6103c4b9d171d3db66af2e0169bf50 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Mon, 17 Mar 2014 00:26:36 +0100 Subject: [PATCH] histogram: man page fixups. --- histogram/histogram | 12 +++++++++++- histogram/tests | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/histogram/histogram b/histogram/histogram index 156841a..98dd55f 100755 --- a/histogram/histogram +++ b/histogram/histogram @@ -51,6 +51,8 @@ One comma separated header+value per line: (echo a,1; echo b,1.01; echo c,3.1) | =head1 OPTIONS +=over 9 + =item B<--delimiter> I =item B<-d> I @@ -67,6 +69,8 @@ Take the logarithm of all values. =item B<--input> I +=item B<-i> I + Give format of input. B will try to guess the input format based on different heuristics. If it guesses wrong, you can override it with B<--input>. I is a string consisting of: @@ -117,9 +121,11 @@ Column 1 is ignored, column 2 is header, column 3 is value, guess separator. =item B<--format> I +=item B<-f> I + Give format of output. I is a string consisting of: -=over 13 +=over 5 =item Z<>B @@ -366,6 +372,10 @@ if($#ARGV != -1) { } else { @raw = (<>); chomp @raw; + if(not @raw) { + # Empty input + exit; + } } diff --git a/histogram/tests b/histogram/tests index 51b5583..8933a06 100755 --- a/histogram/tests +++ b/histogram/tests @@ -21,9 +21,11 @@ echo "## 1,a 2,b command line" histogram 1,a 2,b echo "## 1 2 3 4 command line" histogram 1 2 3 4 -echo "## a 1 b 2 c 3 command line" +echo "## a 1 b 2 c 3 command line - not ideal" histogram a 1 b 2 c 3 -echo "## "a a":1 b:2 c:3 command line" +echo '## "a a":1 b:2 c:3 command line' histogram "a a":1 b:2 c:3 +echo "## null input" +histogram