Add --layout option to specifiy a layout file

Thanks to Esa-Matti Suuronen on GitHub for the suggestion!
This commit is contained in:
Rémi Prévost 2011-02-24 20:58:38 -05:00
parent 34c7ec5649
commit b0bcd52f7e
3 changed files with 12 additions and 4 deletions

View File

@ -19,14 +19,22 @@ opts = OptionParser.new do |opts|
Options:
"
opts.on("--here", "Set up the first window in the current window") do |safe|
opts.on("--here", "Set up the first window in the current window") do
options[:here] = true
end
opts.on("--layout [LAYOUT]", "Use a specific layout file, instead of ~/.teamocil/<layout>.yml") do |layout|
options[:layout] = layout
end
end
opts.parse!
if options.include?(:layout)
file = options[:layout]
else
file = File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml")
end
bail "There is no file \"#{file}\"" unless File.exists?(file)

View File

@ -1,4 +1,4 @@
module Teamocil
VERSION = '0.1.4'
VERSION = '0.1.5'
autoload :Layout, "teamocil/layout"
end

View File

@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = "teamocil"
s.version = "0.1.4"
s.version = "0.1.5"
s.platform = Gem::Platform::RUBY
s.authors = "Rémi Prévost"
s.email = "remi@exomel.com"