diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-12-02 13:14:45 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-12-02 14:51:24 +0100 |
commit | a254bc38f2f49625ab9dffd1609f2f592581b76a (patch) | |
tree | 906767b7ade929e282a03c50f76c06d9e7c354e5 /localsvgtidy | |
parent | 8a3195b00ccd563fa492ea8a235a48a14f623b97 (diff) |
Switch to "indented" style using TABs, and save memory by flushing at each tag.
Diffstat (limited to 'localsvgtidy')
-rwxr-xr-x | localsvgtidy | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/localsvgtidy b/localsvgtidy index 81021b0..507994f 100755 --- a/localsvgtidy +++ b/localsvgtidy @@ -19,7 +19,6 @@ # Depends: libxml-twig-perl # # TODO: Apply (the equivalent of) python-scour -# TODO: Use TAB for indentation use warnings; use strict; @@ -29,8 +28,13 @@ use XML::Twig; my $twig = XML::Twig->new( keep_encoding => 1, keep_atts_order => 1, - pretty_print => 'cvs', - ); + pretty_print => 'indented', + twig_handlers => { + _all_ => sub { $_[0]->flush; }, + } +); + +$twig->set_indent("\t"); if ( my $file= $ARGV[0] ) { $twig->parsefile( $file); |