aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-cli
diff options
context:
space:
mode:
Diffstat (limited to 'adenosine-cli')
-rw-r--r--adenosine-cli/src/bin/adenosine.rs7
-rw-r--r--adenosine-cli/src/lib.rs5
2 files changed, 8 insertions, 4 deletions
diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs
index 931616b..f2200ae 100644
--- a/adenosine-cli/src/bin/adenosine.rs
+++ b/adenosine-cli/src/bin/adenosine.rs
@@ -329,7 +329,8 @@ fn run(opt: Opt) -> Result<()> {
.ok_or(anyhow!("expected collection list"))?
{
println!(
- "{}",
+ "at://{}/{}",
+ uri.repository.to_string(),
c.as_str()
.ok_or(anyhow!("expected collection as a JSON string"))?
);
@@ -343,8 +344,8 @@ fn run(opt: Opt) -> Result<()> {
let records = xrpc_client
.get("com.atproto.repoListRecords", Some(params))?
.ok_or(anyhow!("expected a repoListRecords response"))?;
- for r in records.as_array().unwrap_or(&vec![]).iter() {
- println!("{}", r);
+ for r in records["records"].as_array().unwrap_or(&vec![]).iter() {
+ println!("{}", r["uri"].as_str().unwrap());
}
} else {
return Err(anyhow!("got too much of a URI to 'ls'"));
diff --git a/adenosine-cli/src/lib.rs b/adenosine-cli/src/lib.rs
index a136cea..cecbbe4 100644
--- a/adenosine-cli/src/lib.rs
+++ b/adenosine-cli/src/lib.rs
@@ -287,7 +287,10 @@ fn test_argfield() {
pub fn update_params_from_fields(fields: &[ArgField], params: &mut HashMap<String, String>) {
for f in fields.iter() {
if let ArgField::Query(ref k, ref v) = f {
- params.insert(k.to_string(), v.to_string());
+ match v {
+ Value::String(s) => params.insert(k.to_string(), s.to_string()),
+ _ => params.insert(k.to_string(), v.to_string()),
+ };
}
}
}