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
//! **tmux_interface** as a Rust library provides functionality to communicate with TMUX via CLI.
//!
//! # Description
//!
//! Main purpose of the tmux_interface is to implement simple sending and recieving data mechanisms
//! for some Rust application, using intercommunication with TMUX only via standard streams (stdin,
//! stdout, stderr).
//!
//! This goal can be reached by splitting it into two separate tasks:
//!
//! 1. Providing wrapper functions for tmux subcommands (sending data). Wrapper functions are
//! structured like in tmux manual in few next categories:
//!
//! - Clients and Sessions ([`clients_and_sessions`](crate::clients_and_sessions))
//! - Windows and Panes ([`windows_and_panes`](crate::windows_and_panes))
//! - Key Bindings ([`key_bindings`](crate::key_bindings))
//! - Options ([`options`](crate::options))
//! - Hooks ([`hooks`](crate::hooks))
//! - Global and Session Environment ([`global_and_session_environment`](crate::global_and_session_environment))
//! - Status Line ([`status_line`](crate::status_line))
//! - Buffers ([`buffers`](crate::buffers))
//! - Miscellaneous ([`miscellaneous`](crate::miscellaneous))
//!
//! Main structure is [`TmuxInterface`](crate::tmux_interface::TmuxInterface) wich has all these wrapper functions implementations.
//!
//! 2. Parsing functions for tmux output as rust structures (recieving data). Parsing function are
//! structured by objects they operate with:
//!
//! - [`Sessions`](crate::Sessions)
//! - [`Session`](crate::Session)
//! - [`Windows`](crate::Windows)
//! - [`Window`](crate::Window)
//! - [`Panes`](crate::Panes)
//! - [`Pane`](crate::Pane)
//! - ...
//! - [`TmuxOption`](crate::TmuxOption)
//!
//! # Library Functions
//!
//! 1. Function names and their grouping are inherited from tmux manual
//! 2. Function arguments and their optionality inherited from tmux manual
//! 3. Functions can have max. 4 arguments, otherwise a structure will be used
//!
//! # Examples
//!
//! ```
//! use crate::tmux_interface::TmuxInterface;
//! use crate::tmux_interface::NewSession;
//!
//!
//! fn main() {
//! let tmux = TmuxInterface::new();
//!
//! let new_session = NewSession {
//! detached: Some(true),
//! session_name: Some("test_session_name1"),
//! ..Default::default()
//! };
//! tmux.new_session(&new_session).unwrap();
//! tmux.kill_session(None, None, Some("test_session_name1")).unwrap();
//!
//! // or alternatively
//! let mut new_session = NewSession::new();
//! new_session.detached = Some(true);
//! new_session.session_name = Some("test_session_name2");
//! tmux.new_session(&new_session).unwrap();
//! tmux.kill_session(None, None, Some("test_session_name2")).unwrap();
//! }
//! ```
//!
//!
//! # Examples
//!
//! ```
//! use crate::tmux_interface::Sessions;
//!
//!
//! fn main() {
//! let sessions = Sessions::get().unwrap();
//! }
//! ```
//!
//!
pub use TmuxInterface;
pub use AttachSession;
pub use DetachClient;
pub use NewSession;
pub use RefreshClient;
pub use SwitchClient;
pub use BreakPane;
pub use CapturePane;
pub use ChooseClient;
pub use ChooseTree;
pub use FindWindow;
pub use JoinPane;
pub use LinkWindow;
pub use MovePane;
pub use MoveWindow;
pub use NewWindow;
pub use PipePane;
pub use ResizePane;
pub use ResizeWindow;
pub use RespawnPane;
pub use RespawnWindow;
pub use SelectLayot;
pub use SelectPane;
pub use SelectWindow;
pub use SplitWindow;
pub use SwapPane;
pub use BindKey;
pub use SendKeys;
pub use ShowOptions;
pub use TmuxOption;
pub use Session;
pub use Sessions;
pub use Window;
pub use Windows;
pub use Pane;
pub use Panes;
pub use TmuxInterfaceError;
//mod options_tests;