mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-26 03:54:21 +01:00
Show cmdline in pastes
This commit is contained in:
parent
b7fe220152
commit
999ec05afc
@ -86,25 +86,24 @@ sub show_output {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(exists $self->{options}->{'-paste'} or (defined $self->{got_run} and $self->{got_run} eq "paste")) {
|
if(exists $self->{options}->{'-paste'} or (defined $self->{got_run} and $self->{got_run} eq "paste")) {
|
||||||
my $flags = "";
|
my $cmdline = $self->{cmdline};
|
||||||
|
|
||||||
=cut
|
$cmdline =~ s/\$sourcefile/$self->{sourcefile}/g;
|
||||||
$extracted_args =~ s/-paste //g;
|
$cmdline =~ s/\$execfile/$self->{execfile}/g;
|
||||||
if(length $extracted_args) {
|
|
||||||
$extracted_args =~ s/\s*$//;
|
|
||||||
$flags .= '[' . $extracted_args . '] ';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(length $args) {
|
if (length $self->{cmdline_options}) {
|
||||||
$flags .= "gcc " . $args . " -o $self->{execfile} $self->{sourcefile}";
|
$cmdline =~ s/\$options/$self->{cmdline_options}/g;
|
||||||
} else {
|
} else {
|
||||||
$flags .= $languages{$lang} . " -o $self->{execfile} $self->{sourcefile}";
|
if (length $self->{default_options}) {
|
||||||
|
$cmdline =~ s/\$options/$self->{default_options}/g;
|
||||||
|
} else {
|
||||||
|
$cmdline =~ s/\$options\s+//g;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
=cut
|
|
||||||
|
|
||||||
my $pretty_code = $self->pretty_format($self->{code});
|
my $pretty_code = $self->pretty_format($self->{code});
|
||||||
|
|
||||||
$pretty_code .= "\n\n/************* COMPILER FLAGS *************\n$flags\n************** COMPILER FLAGS *************/\n";
|
$pretty_code .= "\n\n/************* CMDLINE *************\n$cmdline\n************** CMDLINE *************/\n";
|
||||||
|
|
||||||
$output =~ s/\s+$//;
|
$output =~ s/\s+$//;
|
||||||
$pretty_code .= "\n/************* OUTPUT *************\n$output\n************** OUTPUT *************/\n";
|
$pretty_code .= "\n/************* OUTPUT *************\n$output\n************** OUTPUT *************/\n";
|
||||||
@ -215,7 +214,6 @@ sub execute {
|
|||||||
my $pretty_code = $self->pretty_format($self->{code});
|
my $pretty_code = $self->pretty_format($self->{code});
|
||||||
|
|
||||||
my $cmdline = $self->{cmdline};
|
my $cmdline = $self->{cmdline};
|
||||||
$cmdline .= ' -paste' if exists $self->{options}->{'-paste'};
|
|
||||||
|
|
||||||
$cmdline =~ s/\$sourcefile/$self->{sourcefile}/g;
|
$cmdline =~ s/\$sourcefile/$self->{sourcefile}/g;
|
||||||
$cmdline =~ s/\$execfile/$self->{execfile}/g;
|
$cmdline =~ s/\$execfile/$self->{execfile}/g;
|
||||||
|
Loading…
Reference in New Issue
Block a user