Skip to content

Commit

Permalink
Display a usage message when STDIN is a tty.
Browse files Browse the repository at this point in the history
Fixes GH-17 from @petdance.
  • Loading branch information
msabramo committed Apr 25, 2012
1 parent d211bb7 commit a08d04d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/tarcolor
Expand Up @@ -110,6 +110,11 @@ sub default_ls_colors {
return '';
}

if ( -t STDIN ) {
print "Example: tar tvzf some_tarball.tar.gz | tarcolor\n";
exit(0);
}


my %FILE_TYPE_TO_COLOR = (
"di" => "\033[01;34m",
Expand Down

0 comments on commit a08d04d

Please sign in to comment.