MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/workspace/show.rs:66–94  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

64
65impl Command for WorkspaceShow {
66 fn run(&self) -> CliResult<()> {
67 let rt = tokio::runtime::Runtime::new()
68 .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))?;
69
70 rt.block_on(async {
71 let client = build_client(self.org.as_deref(), None).await?;
72 let ws = client.get_workspace(&self.slug).await.map_err(remote_err)?;
73
74 if self.format == "json" {
75 println!("{}", serde_json::to_string_pretty(&ws).unwrap_or_default());
76 return Ok(());
77 }
78
79 let description = ws.description.as_deref().unwrap_or("—").to_string();
80
81 let table = KeyValueTable::new()
82 .add("Name", &ws.name)
83 .add("Slug", &ws.slug)
84 .add("Visibility", ws.visibility.to_string())
85 .add("Description", &description)
86 .add("Owner ID", ws.owner_id.to_string())
87 .add("Created", format_timestamp(&ws.created_at))
88 .add("Updated", format_timestamp(&ws.updated_at));
89
90 println!("{}", table);
91
92 Ok(())
93 })
94 }
95}
96
97#[cfg(test)]

Callers

nothing calls this directly

Calls 4

build_clientFunction · 0.85
format_timestampFunction · 0.85
get_workspaceMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected