mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file2lastrev.rb: separate options for Output
and VPath
So the `--srcdir` option in this file can override the same option in `VPath`.
This commit is contained in:
parent
60f12c7d2e
commit
ac06951c31
3 changed files with 8 additions and 1 deletions
|
@ -53,6 +53,7 @@ class VPath
|
|||
end
|
||||
|
||||
def def_options(opt)
|
||||
opt.separator(" VPath common options:")
|
||||
opt.on("-I", "--srcdir=DIR", "add a directory to search path") {|dir|
|
||||
@additional << dir
|
||||
}
|
||||
|
@ -80,6 +81,10 @@ class VPath
|
|||
@list
|
||||
end
|
||||
|
||||
def add(path)
|
||||
@additional << path
|
||||
end
|
||||
|
||||
def strip(path)
|
||||
prefix = list.map {|dir| Regexp.quote(dir)}
|
||||
path.sub(/\A#{prefix.join('|')}(?:\/|\z)/, '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue