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

Method run

atomic-cli/src/commands/vault/list.rs:115–148  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

113
114impl Command for List {
115 fn run(&self) -> CliResult<()> {
116 // Every form routes (the whole-vault listing carries its
117 // type/size/date columns on the wire; --prefix/--type ride the
118 // request's filters).
119 if crate::commands::rpc::vault_list(self)? {
120 return Ok(());
121 }
122
123 let root = find_repository_root()?;
124 let repo =
125 crate::commands::open_readonly_repository(&root).map_err(CliError::Repository)?;
126
127 let type_filter = self.r#type.as_deref().and_then(VaultEntryType::parse);
128 let prefix = self.prefix.as_deref().unwrap_or("");
129
130 let entries = repo
131 .vault_list(prefix, type_filter)
132 .map_err(CliError::Repository)?;
133
134 render_rows(
135 &entries
136 .iter()
137 .map(|e| EntryRow {
138 path: e.path.clone(),
139 entry_type: e.entry_type.to_string(),
140 size: e.content_size as u64,
141 updated_at: e.updated_at.clone(),
142 })
143 .collect::<Vec<_>>(),
144 self.json,
145 );
146
147 Ok(())
148 }
149}

Callers

nothing calls this directly

Calls 7

vault_listFunction · 0.85
find_repository_rootFunction · 0.85
open_readonly_repositoryFunction · 0.85
render_rowsFunction · 0.85
vault_listMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected