aboutsummaryrefslogtreecommitdiff
path: root/src/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.rs')
-rw-r--r--src/list.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/list.rs b/src/list.rs
new file mode 100644
index 0000000..3baba8f
--- /dev/null
+++ b/src/list.rs
@@ -0,0 +1,14 @@
1use crate::wg::config::WireguardConfig;
2
3pub fn run(wg_conf: &WireguardConfig) {
4 let mut max_length = 0;
5 for p in wg_conf.peers.iter() {
6 if p.name.len() > max_length {
7 max_length = p.name.len();
8 }
9 }
10
11 for p in wg_conf.peers.iter() {
12 println!("{:max_length$} | {}", p.name, p.ip);
13 }
14} \ No newline at end of file