mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-11-04 00:27:23 +01:00 
			
		
		
		
	compiler_vm: added -paste flag to send formatted source/output to paste site and show link instead of output; e.g. cc -paste <code> --> http://somepastesite.com
				
					
				
			This commit is contained in:
		
							parent
							
								
									39a38b58f8
								
							
						
					
					
						commit
						3f771df8bc
					
				@ -13,8 +13,8 @@ use warnings;
 | 
			
		||||
# These are set automatically by the build/commit script
 | 
			
		||||
use constant {
 | 
			
		||||
  BUILD_NAME     => "PBot",
 | 
			
		||||
  BUILD_REVISION => 392,
 | 
			
		||||
  BUILD_DATE     => "2012-11-04",
 | 
			
		||||
  BUILD_REVISION => 393,
 | 
			
		||||
  BUILD_DATE     => "2012-11-14",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
 | 
			
		||||
@ -151,6 +151,9 @@ $lang = uc $1 if $code =~ s/-lang=([^\b\s]+)//i;
 | 
			
		||||
my $input = "";
 | 
			
		||||
$input = $1 if $code =~ s/-(?:input|stdin)=(.*)$//i;
 | 
			
		||||
 | 
			
		||||
my $got_paste = undef;
 | 
			
		||||
$got_paste = 1 if $code =~ s/^\s*-paste\s*//i;
 | 
			
		||||
 | 
			
		||||
my $args = "";
 | 
			
		||||
$args .= "$1 " while $code =~ s/^\s*(-[^ ]+)\s*//;
 | 
			
		||||
$args =~ s/\s+$//;
 | 
			
		||||
@ -938,7 +941,7 @@ unless($got_run) {
 | 
			
		||||
  close FILE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if(defined $got_run and $got_run eq "paste") {
 | 
			
		||||
if(defined $got_paste or (defined $got_run and $got_run eq "paste")) {
 | 
			
		||||
  $code .= "\n\n/************* OUTPUT *************\n$output************** OUTPUT **************/\n"; 
 | 
			
		||||
  my $uri = paste_sprunge(pretty($code));
 | 
			
		||||
  print "$nick: $uri\n";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user