diff options
Diffstat (limited to 'code')
-rw-r--r-- | code/runcontext.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/code/runcontext.rb b/code/runcontext.rb index 3d9ff457..1e10aa8d 100644 --- a/code/runcontext.rb +++ b/code/runcontext.rb @@ -114,13 +114,26 @@ class RunContext ## rc.paths.map {|x| ~x}.join(' ') ## otherwise: ## ~(rc.paths.first) - def ~() @paths.map {|x| ~x}.join(' ') end + def ~ + if @multi + @paths.map {|x| ~x}.join(' ') + else + ~@paths.first + end + end + + ## escape one (the first) file for direct use in the shell. + ## this is a shortcut for: + ## ~(rc.paths.first) + def one + ~@paths.first + end ## shortcut for _files.size_ def size() @files.size end ## shortcut for _files.first.path_ - def first() @files.first.path end + def first() @files.first end ## shortcut for _files.first.name_ def name() @files.first.name end |