From 0d00d1fb74f0c677f912b9bb8b123aca40912f22 Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Sun, 27 Jun 2021 13:20:51 +0200 Subject: [PATCH] Produce human readable output in list --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 06ab060..2867c58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,7 +85,16 @@ fn list(opts: &ListOpts) -> Result<(), anyhow::Error> { if opts.json { println!("{}", serde_json::to_string(&locations)?); } else { - println!("{:?}", &locations); + for (i, location) in locations.locations.iter().enumerate() { + if i > 0 { + println!() + }; + println!("Name: {}", location.name); + println!("City: {}", location.city); + println!("Country: {}", location.country); + println!("Country code: {}", location.iso); + println!("WireGuard endpoint: {}", location.endpoints.wireguard); + } } Ok(()) }