This commit is contained in:
Ev Bogdanov 2017-01-26 19:29:57 +03:00
commit c2271ba672
43 changed files with 886 additions and 0 deletions

17
bin/t2s Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env perl
use strict;
use warnings;
my $N_SPACES = $ARGV[0] || 4;
while (my $line = <STDIN>) {
# Skip empty lines
print "\n" and next if $line !~ m/\S/;
$line =~ m/^(\t*)(.+)$/;
my $n_tabs = length($1);
my $n_spaces = $n_tabs * $N_SPACES;
print ' ' x $n_spaces . "$2\n";
}