mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Refactor handling of --version flags; add --analyze
Move handling of certain language-specific flags out of compiler_vm_server.pl and into their own language modules. Add support for clang --analyze. Java now understands -version.
This commit is contained in:
parent
ab39220fd5
commit
03baaeb81c
@ -126,13 +126,7 @@ sub interpret {
|
||||
|
||||
$mod->preprocess;
|
||||
|
||||
if($cmdline =~ m/-?-version/) {
|
||||
# cmdline contained version request, so don't postprocess and just return the version output
|
||||
$mod->{output} =~ s/\s+\(Ubuntu.*-\d+ubuntu\d+\)//;
|
||||
return $mod->{output};
|
||||
}
|
||||
|
||||
$mod->postprocess if not $mod->{error};
|
||||
$mod->postprocess if not $mod->{error} and not $mod->{done};
|
||||
|
||||
if (exists $mod->{no_output} or not length $mod->{output}) {
|
||||
$mod->{output} .= "\n" if length $mod->{output};
|
||||
|
@ -6,6 +6,15 @@ use strict;
|
||||
package _c_base;
|
||||
use parent '_default';
|
||||
|
||||
sub preprocess {
|
||||
my $self = shift;
|
||||
$self->SUPER::preprocess;
|
||||
|
||||
if ($self->{cmdline} =~ m/--(?:version|analyze)/) {
|
||||
$self->{done} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub postprocess {
|
||||
my $self = shift;
|
||||
|
||||
|
@ -6,6 +6,15 @@ use strict;
|
||||
package java;
|
||||
use parent '_default';
|
||||
|
||||
sub preprocess {
|
||||
my $self = shift;
|
||||
$self->SUPER::preprocess;
|
||||
|
||||
if ($self->{cmdline} =~ m/-version/) {
|
||||
$self->{done} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub postprocess {
|
||||
my $self = shift;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user