#!/usr/bin/perl use OGDL::Parser; use Getopt::Std; %options=(); getopts("d:g:n:p:chro",\%options); if($#ARGV <0 ||defined $options{h}) { print <0){ $root=$ARGV[1]; } my $ogdl=OGDL::Parser->new($root); if(!$ARGV[1]){ $ogdl->read(*STDIN); } else{ open my $input, "<$ARGV[1]" or die "Can't open $ARGV[1]\n"; $ogdl->read($input); } $g=$ogdl->parse; if(!$g){die "Coundn't parse file: $ARGV[1]\n";} my $path=$ARGV[0]; $g->gremove($path); my $depth=0; my $indent=4; my $singlequote=1; my $noblockquote=1; my $group=-1; if(exists $options{g}){$group=$options{g};} if($options{n}){$indent=$options{n};} #$g->print("group"=>$group, "indentwidth"=>$indent,"singlequote"=>$singlequote,"noblockquote"=>$noblockquote); open my $output, ">$ARGV[1]" or die "Can't write to $ARGV[1]\n"; my $l=$g->{"list"}; foreach (@$l){ $_->print("filehandle"=>$output,"group"=>$group, "indentwidth"=>$indent,"singlequote"=>$singlequote,"noblockquote"=>$noblockquote); }