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
#[test]
fn new_window() {
use crate::{NewWindow, TargetWindow};
use std::borrow::Cow;
// Structure for creating new window, using `tmux new-window` command
//
// # Manual
//
// tmux ^3.2:
// ```text
// new-window [-abdkPS] [-c start-directory] [-e environment] [-F format] [-n window-name]
// [-t target-window] [shell-command]
// (alias: neww)
// ```
//
// tmux ^3.0:
// ```text
// new-window [-adkP] [-c start-directory] [-e environment] [-F format] [-n window-name] [-t
// target-window] [shell-command]
// (alias: neww)
// ```
//
// tmux ^1.7:
// ```text
// new-window [-adkP] [-c start-directory] [-F format] [-n window-name] [-t target-window]
// [shell-command]
// (alias: neww)
// ```
//
// tmux ^1.5:
// ```text
// new-window [-adkP] [-n window-name] [-t target-window] [shell-command]
// (alias: neww)
// ```
//
// tmux ^1.3:
// ```text
// new-window [-adk] [-n window-name] [-t target-window] [shell-command]
// (alias: neww)
// ```
//
// tmux ^1.2:
// ```text
// new-window [-dk] [-n window-name] [-t target-window] [shell-command]
// (alias: neww)
// ```
//
// tmux ^1.0:
// ```text
// new-window [-dk] [-n window-name] [-t target-window] [command]
// (alias: neww)
// ```
//
// tmux ^0.8:
// ```text
// new-window [-d] [-n window-name] [-t target-window] [command]
// (alias: neww)
// ```
let target_window = TargetWindow::Raw("5").to_string();
let new_window = NewWindow::new();
#[cfg(feature = "tmux_1_3")]
let new_window = new_window.after();
#[cfg(feature = "tmux_3_2")]
let new_window = new_window.before();
#[cfg(feature = "tmux_0_8")]
let new_window = new_window.detached();
#[cfg(feature = "tmux_1_0")]
let new_window = new_window.kill();
#[cfg(feature = "tmux_1_5")]
let new_window = new_window.print();
#[cfg(feature = "tmux_3_2")]
let new_window = new_window.select();
#[cfg(feature = "tmux_1_7")]
let new_window = new_window.start_directory("1");
#[cfg(feature = "tmux_3_0")]
let new_window = new_window.environment("2");
#[cfg(feature = "tmux_1_7")]
let new_window = new_window.format("3");
#[cfg(feature = "tmux_0_8")]
let new_window = new_window.window_name("4");
#[cfg(feature = "tmux_0_8")]
let new_window = new_window.target_window(&target_window);
#[cfg(feature = "tmux_1_2")]
let new_window = new_window.shell_command("6");
#[cfg(not(feature = "cmd_alias"))]
let cmd = "new-window";
#[cfg(feature = "cmd_alias")]
let cmd = "neww";
let mut s = Vec::new();
s.push(cmd);
#[cfg(feature = "tmux_1_3")]
s.push("-a");
#[cfg(feature = "tmux_3_2")]
s.push("-b");
#[cfg(feature = "tmux_0_8")]
s.push("-d");
#[cfg(feature = "tmux_1_0")]
s.push("-k");
#[cfg(feature = "tmux_1_5")]
s.push("-P");
#[cfg(feature = "tmux_3_2")]
s.push("-S");
#[cfg(feature = "tmux_1_7")]
s.extend_from_slice(&["-c", "1"]);
#[cfg(feature = "tmux_3_0")]
s.extend_from_slice(&["-e", "2"]);
#[cfg(feature = "tmux_1_7")]
s.extend_from_slice(&["-F", "3"]);
#[cfg(feature = "tmux_0_8")]
s.extend_from_slice(&["-n", "4"]);
#[cfg(feature = "tmux_0_8")]
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 new_window = new_window.build().to_vec();
assert_eq!(new_window, s);
}