From 16dce2c4843ba3676f368f50aac2e853104bb6cb Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 15 Jan 2015 22:00:20 -0800 Subject: [PATCH] Add -info standard option to show cmdline information --- modules/compiler_vm/languages/_default.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/compiler_vm/languages/_default.pm b/modules/compiler_vm/languages/_default.pm index 21ab6f83..74576902 100755 --- a/modules/compiler_vm/languages/_default.pm +++ b/modules/compiler_vm/languages/_default.pm @@ -14,7 +14,7 @@ use LWP::UserAgent; use Time::HiRes qw/gettimeofday/; use Text::Balanced qw/extract_delimited/; -my $EXECUTE_PORT = '6333'; +my $EXECUTE_PORT = '3333'; sub new { my ($class, %conf) = @_; @@ -109,7 +109,7 @@ sub show_output { $output =~ s/\s+$//; $pretty_code .= "\n/************* OUTPUT *************\n$output\n************** OUTPUT *************/\n"; - my $uri = paste_sprunge($pretty_code); + my $uri = $self->paste_sprunge($pretty_code); print "$self->{nick}: $uri\n"; exit 0; @@ -278,6 +278,19 @@ sub process_standard_options { my $self = shift; my $code = $self->{code}; + if ($code =~ s/(?:^|(?<=\s))-info\s*//i) { + my $cmdline = $self->{cmdline}; + if (length $self->{default_options}) { + $cmdline =~ s/\$options/$self->{default_options}/; + } else { + $cmdline =~ s/\$options\s+//; + } + $cmdline =~ s/\$sourcefile/$self->{sourcefile}/g; + $cmdline =~ s/\$execfile/$self->{execfile}/g; + print "$self->{nick}: $self->{lang} cmdline: $cmdline\n"; + exit; + } + if ($code =~ s/-(?:input|stdin)=(.*)$//i) { $self->add_option("-input", $1); }