diff --git a/src/command/area.rs b/src/command/area.rs index 702c717..06823ab 100644 --- a/src/command/area.rs +++ b/src/command/area.rs @@ -1,4 +1,7 @@ -use crate::{rpc, Result}; +use crate::{ + rpc::{self, RpcResponse}, + Result, +}; use clap::Args; use serde_json::{json, Value}; @@ -8,7 +11,15 @@ pub struct GetAreaArgs { } pub fn get_area(args: &GetAreaArgs) -> Result<()> { - rpc::call("get_area", json!({"id": args.id}))?.print() + rpc::call("get_area", json!({"id": args.id})) + .map(|it| RpcResponse { + result: it.result.map(|mut it| { + it["tags"].as_object_mut().unwrap().remove("geo_json"); + it + }), + error: it.error, + })? + .print() } #[derive(Args)] diff --git a/src/rpc.rs b/src/rpc.rs index 1487f69..0ee27f5 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -2,11 +2,12 @@ use crate::settings; use crate::Result; use colored_json::ToColoredJson; use serde::Deserialize; +use serde_json::Map; use serde_json::{json, Value}; #[derive(Deserialize)] pub struct RpcResponse { - pub result: Option, + pub result: Option>, pub error: Option, }