(&self)
| 113 | |
| 114 | impl 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 | } |
nothing calls this directly
no test coverage detected