Produce human readable output in list
This commit is contained in:
parent
fc0b55a207
commit
0d00d1fb74
1 changed files with 10 additions and 1 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -85,7 +85,16 @@ fn list(opts: &ListOpts) -> Result<(), anyhow::Error> {
|
||||||
if opts.json {
|
if opts.json {
|
||||||
println!("{}", serde_json::to_string(&locations)?);
|
println!("{}", serde_json::to_string(&locations)?);
|
||||||
} else {
|
} 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue