Skip to content

Commit 22abf52

Browse files
committed
Implement asimov handle list.
1 parent 2bf28e8 commit 22abf52

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/commands/handle/list.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
// This is free and unencumbered software released into the public domain.
22

33
use crate::StandardOptions;
4+
use asimov_directory::fs::HandleResolver;
5+
use color_print::ceprintln;
46
use core::error::Error;
7+
use futures_lite::{pin, stream::StreamExt};
58

69
pub async fn list(_flags: &StandardOptions) -> Result<(), Box<dyn Error>> {
7-
Ok(()) // TODO
10+
let mut resolver = HandleResolver::default().await?;
11+
let handles = resolver.handles();
12+
pin!(handles);
13+
14+
while let Some(handle) = handles.next().await {
15+
ceprintln!("{}", handle?);
16+
}
17+
18+
Ok(())
819
}

0 commit comments

Comments
 (0)