# HG changeset patch # User anatofuz # Date 1573711843 -32400 # Node ID 37a0df8b1889d737906527e41b5f52e3a9d7c5bf # Parent e960539c003d9a88a60850b06ac73fbffb03aec2 tweak update_context.pl diff -r e960539c003d -r 37a0df8b1889 src/gearsTools/update_context.pl --- a/src/gearsTools/update_context.pl Thu Nov 14 11:33:13 2019 +0900 +++ b/src/gearsTools/update_context.pl Thu Nov 14 15:10:43 2019 +0900 @@ -3,13 +3,19 @@ use warnings; use Getopt::Std; +my %opt; +getopts("wc" => \%opt); + my $interface_file = shift or die "require itnerface file"; my $h2context = parse_interface($interface_file); my $context = dump_h2context($h2context); -my ($first,$last) = slup_context_h($h2context->{name}); -my %opt; -getopts("w" => \%opt); +if ($opt{c}) { + print "$context"; + exit 0; +} + +my ($first,$last) = slup_context_h($h2context->{name}); if ($opt{w}) { context_write(@{$first},$context,@{$last}); @@ -86,7 +92,7 @@ $context = "${space}struct $h2context->{name} {\n"; for my $datum (@{$h2context->{data}}) { #print "${space}${space}$datum; \n"; - $context .= "${space}${space}$datum; \n"; + $context .= "${space}${space}$datum;\n"; } for my $code (@{$h2context->{codes}}) { #print "${space}${space}enum Code $code;\n";