Add --layout
option to specifiy a layout file
Thanks to Esa-Matti Suuronen on GitHub for the suggestion!
This commit is contained in:
parent
34c7ec5649
commit
b0bcd52f7e
12
bin/teamocil
12
bin/teamocil
@ -19,14 +19,22 @@ opts = OptionParser.new do |opts|
|
|||||||
|
|
||||||
Options:
|
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
|
options[:here] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("--layout [LAYOUT]", "Use a specific layout file, instead of ~/.teamocil/<layout>.yml") do |layout|
|
||||||
|
options[:layout] = layout
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
opts.parse!
|
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)
|
bail "There is no file \"#{file}\"" unless File.exists?(file)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module Teamocil
|
module Teamocil
|
||||||
VERSION = '0.1.4'
|
VERSION = '0.1.5'
|
||||||
autoload :Layout, "teamocil/layout"
|
autoload :Layout, "teamocil/layout"
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
spec = Gem::Specification.new do |s|
|
spec = Gem::Specification.new do |s|
|
||||||
s.name = "teamocil"
|
s.name = "teamocil"
|
||||||
s.version = "0.1.4"
|
s.version = "0.1.5"
|
||||||
s.platform = Gem::Platform::RUBY
|
s.platform = Gem::Platform::RUBY
|
||||||
s.authors = "Rémi Prévost"
|
s.authors = "Rémi Prévost"
|
||||||
s.email = "remi@exomel.com"
|
s.email = "remi@exomel.com"
|
||||||
|
Loading…
Reference in New Issue
Block a user