about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--code/runcontext.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/code/runcontext.rb b/code/runcontext.rb
index d3a0b9d1..df9f3a81 100644
--- a/code/runcontext.rb
+++ b/code/runcontext.rb
@@ -33,21 +33,21 @@ class RunContext
 	end
 	## }}}
 
-	def initialize(files, mode=0, flags='')
+	def initialize(files, mode=nil, flags=nil, preferred_app=nil)
 		@mode = mode.to_i
 		if files.is_a? Array
 			@files = files.dup
 		else
 			@files = [files.dup]
 		end
-		self.flags = flags
+		self.flags = flags || ''
 		
 		@files.reject! {|file|
 			file.handler == nil or !file.exists?
 		}
 		@handlers = @files.map {|file| file.handler}
 		@paths = @files.map {|file| file.path}
-		@handler = @handlers.first
+		@handler = preferred_app || @handlers.first
 
 		@multi = (@files.size > 1 and @handlers.uniq.size == 1)
 
n5' href='#n5'>5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
39
40
41
42
43
44
45
46
47
48
49
50