Added target param to splits

target maps to -t on split-window
This commit is contained in:
Jimmy Bourassa 2011-09-25 00:04:16 -04:00
parent ae34459d7c
commit 7369a81413
2 changed files with 7 additions and 6 deletions

View File

@ -33,6 +33,7 @@ Teamocil is a tool used to automatically create sessions, windows and splits in
width: 50
- cmd: memcached -p 11211 -vv
height: 25
target: bottom-right
Running `$ teamocil sample` will rename the session to `sample-session` and create a new window named `sample-window` with a layout like this:

View File

@ -34,14 +34,14 @@ module Teamocil
window["splits"].each_with_index do |split, index|
unless index == 0
if split.include?("width")
output << "tmux split-window -h -p #{split["width"]}"
cmd = "tmux split-window -h -p #{split["width"]}"
elsif split.include?("height")
cmd = "tmux split-window -p #{split["height"]}"
else
if split.include?("height")
output << "tmux split-window -p #{split["height"]}"
else
output << "tmux split-window"
end
cmd = "tmux split-window"
end
cmd << " -t #{split["target"]}" if split.include?("target")
output << cmd
end
# Support single command splits, but treat it as an array nevertheless