From a254bc38f2f49625ab9dffd1609f2f592581b76a Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 2 Dec 2014 13:14:45 +0100 Subject: Switch to "indented" style using TABs, and save memory by flushing at each tag. --- localsvgtidy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'localsvgtidy') 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); -- cgit v1.2.3