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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
use crate::TmuxCommand;

/// All functions from man tmux "Status line" listed below
/// ([man tmux](http://man7.org/linux/man-pages/man1/tmux.1.html#STATUS_LINE))
#[cfg(feature = "tmux_3_3")]
pub mod clear_prompt_history;
#[cfg(feature = "tmux_3_3")]
pub mod clear_prompt_history_macro;

#[cfg(feature = "tmux_0_8")]
pub mod command_prompt;
#[cfg(feature = "tmux_0_8")]
pub mod command_prompt_macro;

#[cfg(feature = "tmux_0_9")]
pub mod confirm_before;
#[cfg(feature = "tmux_0_9")]
pub mod confirm_before_macro;

#[cfg(feature = "tmux_3_0")]
pub mod display_menu;
#[cfg(feature = "tmux_3_0")]
pub mod display_menu_macro;

#[cfg(feature = "tmux_1_0")]
pub mod display_message;
#[cfg(feature = "tmux_1_0")]
pub mod display_message_macro;

//#[cfg(feature = "tmux_1_0")]
//pub mod select_prompt;
#[cfg(feature = "tmux_3_2")]
pub mod display_popup;
#[cfg(feature = "tmux_3_2")]
pub mod display_popup_macro;

#[cfg(feature = "tmux_3_3")]
pub mod show_prompt_history;
#[cfg(feature = "tmux_3_3")]
pub mod show_prompt_history_macro;

#[cfg(feature = "tmux_3_3")]
pub use clear_prompt_history::{ClearPHist, ClearPromptHistory};
#[cfg(feature = "tmux_0_8")]
pub use command_prompt::CommandPrompt;
#[cfg(feature = "tmux_0_9")]
pub use confirm_before::{Confirm, ConfirmBefore};
#[cfg(feature = "tmux_3_0")]
pub use display_menu::{DisplayMenu, Menu};
#[cfg(feature = "tmux_1_0")]
pub use display_message::{Display, DisplayMessage};
//#[cfg(feature = "tmux_1_0")]
//pub use select_prompt::SelectPrompt;
#[cfg(feature = "tmux_3_2")]
pub use display_popup::{DisplayPopup, Popup};
#[cfg(feature = "tmux_3_3")]
pub use show_prompt_history::{ShowPHist, ShowPromptHistory};

#[cfg(test)]
#[path = "."]
mod status_line_tests {
    #[cfg(feature = "tmux_3_3")]
    pub mod clear_prompt_history_tests;
    #[cfg(feature = "tmux_0_8")]
    pub mod command_prompt_tests;
    #[cfg(feature = "tmux_0_9")]
    pub mod confirm_before_tests;
    #[cfg(feature = "tmux_3_0")]
    pub mod display_menu_tests;
    #[cfg(feature = "tmux_1_0")]
    pub mod display_message_tests;
    #[cfg(feature = "tmux_3_2")]
    pub mod display_popup_tests;
    #[cfg(feature = "tmux_3_3")]
    pub mod show_prompt_history_tests;
}

/// All functions from man tmux "Status line" listed below
/// ([man tmux](http://man7.org/linux/man-pages/man1/tmux.1.html#STATUS_LINE))
impl<'a> TmuxCommand<'a> {
    #[cfg(feature = "tmux_3_3")]
    pub fn clear_prompt_history() -> ClearPromptHistory<'a> {
        ClearPromptHistory::new()
    }

    #[cfg(feature = "tmux_0_8")]
    pub fn command_prompt() -> CommandPrompt<'a> {
        CommandPrompt::new()
    }

    #[cfg(feature = "tmux_0_9")]
    pub fn confirm_before() -> ConfirmBefore<'a> {
        ConfirmBefore::new()
    }

    #[cfg(feature = "tmux_3_0")]
    pub fn display_menu() -> DisplayMenu<'a> {
        DisplayMenu::new()
    }

    #[cfg(feature = "tmux_1_0")]
    pub fn display_message() -> DisplayMessage<'a> {
        DisplayMessage::new()
    }

    #[cfg(feature = "tmux_3_2")]
    pub fn display_popup() -> DisplayPopup<'a> {
        DisplayPopup::new()
    }

    #[cfg(feature = "tmux_3_3")]
    pub fn show_prompt_history() -> ShowPromptHistory<'a> {
        ShowPromptHistory::new()
    }
}

#[cfg(feature = "tmux_3_3")]
impl<'a> From<ClearPromptHistory<'a>> for TmuxCommand<'a> {
    fn from(item: ClearPromptHistory<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_0_8")]
impl<'a> From<CommandPrompt<'a>> for TmuxCommand<'a> {
    fn from(item: CommandPrompt<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_0_9")]
impl<'a> From<ConfirmBefore<'a>> for TmuxCommand<'a> {
    fn from(item: ConfirmBefore<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_3_0")]
impl<'a> From<DisplayMenu<'a>> for TmuxCommand<'a> {
    fn from(item: DisplayMenu<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_1_0")]
impl<'a> From<DisplayMessage<'a>> for TmuxCommand<'a> {
    fn from(item: DisplayMessage<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_3_2")]
impl<'a> From<DisplayPopup<'a>> for TmuxCommand<'a> {
    fn from(item: DisplayPopup<'a>) -> Self {
        item.build()
    }
}

#[cfg(feature = "tmux_3_3")]
impl<'a> From<ShowPromptHistory<'a>> for TmuxCommand<'a> {
    fn from(item: ShowPromptHistory<'a>) -> Self {
        item.build()
    }
}