1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#[test]
fn split_window() {
use crate::{PaneSize, SplitWindow, TargetPane};
use std::borrow::Cow;
// Create a new pane by splitting target-pane
//
// # Manual
//
// tmux ^3.1:
// ```text
// split-window [-bdfhIvP] [-c start-directory] [-e environment] [-l size] [-t target-pane]
// [shell-command] [-F format]
// (alias: splitw)
// ```
//
// tmux ^3.0:
// ```text
// split-window [-bdfhIvP] [-c start-directory] [-e environment] [-l size | -p percentage]
// [-t target-pane] [shell-command] [-F format]
// (alias: splitw)
// ```
//
// tmux ^2.4:
// ```text
// split-window [-bdfhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane]
// [shell-command] [-F format]
// (alias: splitw)
// ```
//
// tmux ^2.0:
// ```text
// split-window [-bdhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane]
// [shell-command] [-F format]
// (alias: splitw)
// ```
//
// tmux ^1.7:
// ```text
// split-window [-dhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane]
// [shell-command] [-F format]
// (alias: splitw)
// ```
//
// tmux ^1.5:
// ```text
// split-window [-dhvP] [-l size | -p percentage] [-t target-pane] [shell-command]
// (alias: splitw)
// ```
//
// tmux ^1.2:
// ```text
// split-window [-dhv] [-l size | -p percentage] [-t target-pane] [shell-command]
// (alias: splitw)
// ```
//
// tmux ^1.0:
// ```text
// split-window [-dhv] [-l size | -p percentage] [-t target-window] [command]
// (alias: splitw)
// ```
//
// tmux ^0.8:
// ```text
// split-window [-d] [-l size | -p percentage] [-t target-window] [command]
// (alias: splitw)
// ```
let target_pane = TargetPane::Raw("5").to_string();
let split_window = SplitWindow::new();
#[cfg(feature = "tmux_2_4")]
let split_window = split_window.before();
#[cfg(feature = "tmux_0_8")]
let split_window = split_window.detached();
#[cfg(feature = "tmux_2_4")]
let split_window = split_window.full();
#[cfg(feature = "tmux_1_0")]
let split_window = split_window.horizontal();
#[cfg(feature = "tmux_3_0")]
let split_window = split_window.stdin_forward();
#[cfg(feature = "tmux_1_0")]
let split_window = split_window.vertical();
#[cfg(feature = "tmux_1_5")]
let split_window = split_window.print();
#[cfg(feature = "tmux_1_7")]
let split_window = split_window.start_directory("1");
#[cfg(feature = "tmux_3_1")]
let split_window = split_window.environment("2");
#[cfg(feature = "tmux_0_8")]
let split_window = split_window.size(&PaneSize::Size(3));
#[cfg(feature = "tmux_1_7")]
let split_window = split_window.format("4");
#[cfg(feature = "tmux_1_2")]
let split_window = split_window.target_pane(&target_pane);
#[cfg(feature = "tmux_1_2")]
let split_window = split_window.shell_command("6");
#[cfg(not(feature = "cmd_alias"))]
let cmd = "split-window";
#[cfg(feature = "cmd_alias")]
let cmd = "splitw";
let mut s = Vec::new();
s.push(cmd);
#[cfg(feature = "tmux_2_4")]
s.push("-b");
#[cfg(feature = "tmux_0_8")]
s.push("-d");
#[cfg(feature = "tmux_2_4")]
s.push("-f");
#[cfg(feature = "tmux_1_0")]
s.push("-h");
#[cfg(feature = "tmux_3_0")]
s.push("-I");
#[cfg(feature = "tmux_1_0")]
s.push("-v");
#[cfg(feature = "tmux_1_5")]
s.push("-P");
#[cfg(feature = "tmux_1_7")]
s.extend_from_slice(&["-c", "1"]);
#[cfg(feature = "tmux_3_1")]
s.extend_from_slice(&["-e", "2"]);
#[cfg(feature = "tmux_0_8")]
s.extend_from_slice(&["-l", "3"]);
#[cfg(feature = "tmux_1_7")]
s.extend_from_slice(&["-F", "4"]);
#[cfg(feature = "tmux_1_2")]
s.extend_from_slice(&["-t", "5"]);
#[cfg(feature = "tmux_1_2")]
s.push("6");
let s: Vec<Cow<str>> = s.into_iter().map(|a| a.into()).collect();
let split_window = split_window.build().to_vec();
assert_eq!(split_window, s);
}