use anyhow::Result;
use clap::Parser;
#[derive(Parser)]
pub enum Command {
List {
url: String,
},
}
pub fn run(cmd: Command) -> Result<()> {
match cmd {
Command::List { url } => {
use triblespace::prelude::BranchStore;
use triblespace_core::repo::objectstore::ObjectStoreRemote;
use url::Url;
let url = Url::parse(&url)?;
let mut remote: ObjectStoreRemote = ObjectStoreRemote::with_url(&url)?;
let iter = remote.branches()?;
for branch_res in iter {
let id = branch_res?;
println!("{id:X}");
}
Ok(())
}
}
}