From b0bcd52f7ee59502ba580dd946367f37a3a8f6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Pr=C3=A9vost?= Date: Thu, 24 Feb 2011 20:58:38 -0500 Subject: [PATCH] Add `--layout` option to specifiy a layout file Thanks to Esa-Matti Suuronen on GitHub for the suggestion! --- bin/teamocil | 12 ++++++++++-- lib/teamocil.rb | 2 +- teamocil.gemspec | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/teamocil b/bin/teamocil index 52db55e..689f646 100755 --- a/bin/teamocil +++ b/bin/teamocil @@ -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/.yml") do |layout| + options[:layout] = layout + end + end opts.parse! -file = File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml") +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) diff --git a/lib/teamocil.rb b/lib/teamocil.rb index 57543ec..9a2026e 100644 --- a/lib/teamocil.rb +++ b/lib/teamocil.rb @@ -1,4 +1,4 @@ module Teamocil - VERSION = '0.1.4' + VERSION = '0.1.5' autoload :Layout, "teamocil/layout" end diff --git a/teamocil.gemspec b/teamocil.gemspec index 67dd4c8..e1f0226 100644 --- a/teamocil.gemspec +++ b/teamocil.gemspec @@ -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"