@@ -98,6 +98,7 @@ my $retcode = 0;
98
98
my $query = 0;
99
99
my $trace_prop ;
100
100
my $trace_label ;
101
+ my $indent_str = " \t " ;
101
102
102
103
my @redo_comments ;
103
104
my @cmdline ;
@@ -180,6 +181,22 @@ while ($ARGV[0] =~ /^-/)
180
181
{
181
182
$query = 1;
182
183
}
184
+ elsif ($arg eq ' -S' )
185
+ {
186
+ my $indent_spaces = shift @ARGV ;
187
+ if (!defined $indent_spaces )
188
+ {
189
+ print STDERR (" * Spaces count parameter missing\n " );
190
+ usage();
191
+ }
192
+ elsif ($indent_spaces !~ / ^\d +$ / )
193
+ {
194
+ print STDERR (" * Invalid spaces count parameter. Expected an integer.\n " );
195
+ usage();
196
+ }
197
+ $indent_str = ' ' x $indent_spaces ;
198
+ push @cmdline , $arg , $indent_spaces ;
199
+ }
183
200
else
184
201
{
185
202
print STDERR (" * Unknown option '$arg '\n " );
@@ -1161,17 +1178,15 @@ sub resolve_alias
1161
1178
sub dump_node
1162
1179
{
1163
1180
my ($node , $depth ) = @_ ;
1164
- my $indent = " \t " x $depth ;
1181
+ my $indent = $indent_str x $depth ;
1165
1182
1166
1183
print ($indent , join (' : ' , get_labels($node ), $node -> [0]), " {\n " );
1167
1184
1168
- $indent = " \t " x $depth ;
1169
-
1170
1185
# Properties
1171
1186
foreach my $prop (get_props($node ))
1172
1187
{
1173
1188
my @terms ;
1174
- print ($indent , " \t " , $prop -> [0]);
1189
+ print ($indent , $indent_str , $prop -> [0]);
1175
1190
for (my $i = 1; $i < @$prop ; $i ++)
1176
1191
{
1177
1192
my $chunk = $prop -> [$i ];
@@ -2068,6 +2083,7 @@ sub usage
2068
2083
print STDERR (" -p Emulate Pi firmware manipulation\n " );
2069
2084
print STDERR (" -r Redo command comment in named files (c.f. '-c')\n " );
2070
2085
print STDERR (" -s Sort nodes and properties (for easy comparison)\n " );
2086
+ print STDERR (" -S <n> Instead of tabs, use 'n' spaces for indentation\n " );
2071
2087
print STDERR (" -t Trace\n " );
2072
2088
print STDERR (" -w Show warnings\n " );
2073
2089
0 commit comments