overlay|o
stack|s
width|w=i
-}) or exit 1;
+}) or do {
+ print STDERR <<END;
+usage: git-graph [options]
+ -c | --cancel +/- counts cancel out
+ -o | --overlay +/- counts are overlaid as # (default)
+ -s | --cancel +/- counts are stacked
+ --height [n] Set height of graph
+ -h [n] (height of terminal is default)
+ --width [n] Set horizontal scale
+ -w [n] (fit to width of terminal by default)
+END
+ exit 1;
+};
$opt{overlay} = 1 unless $opt{cancel} or $opt{stack};
"#" x ($mod && 1 + $mod * $scale),
"+" x ($add && 1 + $add * $scale),
"-" x ($del && 1 + $del * $scale);
- if (length $line > $width) {
+ if (length $line > $width + 30) {
$line = sprintf "## %d ##\e[32m++ %d ++\e[31m-- %d --\e[0m\n",
$mod, $add, $del;
$line = "$greg \e[33m" . "#"x($width + 16 - length $line) . $line;