diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-02-10 11:12:49 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-02-10 11:12:49 -0800 |
commit | 4f4c1e78186ad9bcd77f3536ef30dd5a130ec2d7 (patch) | |
tree | b1015ec2278426e30a969da37f9eaf746cff9378 /fatcat-cli/src/main.rs | |
parent | 6a0e0d122b70c282f28eb0aec83780f9d3edc995 (diff) | |
download | fatcat-cli-4f4c1e78186ad9bcd77f3536ef30dd5a130ec2d7.tar.gz fatcat-cli-4f4c1e78186ad9bcd77f3536ef30dd5a130ec2d7.zip |
search: container and file indexes
Diffstat (limited to 'fatcat-cli/src/main.rs')
-rw-r--r-- | fatcat-cli/src/main.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fatcat-cli/src/main.rs b/fatcat-cli/src/main.rs index 72cb169..b3a5db3 100644 --- a/fatcat-cli/src/main.rs +++ b/fatcat-cli/src/main.rs @@ -553,6 +553,26 @@ fn run(opt: Opt) -> Result<()> { )?; writeln!(&mut std::io::stdout(), "{}", entity.to_json_string()?)? } + (false, true, SearchEntityType::Container) => { + let specifier = + Specifier::Container(hit["ident"].as_str().unwrap().to_string()); + let entity = specifier.get_from_api( + &mut api_client, + expand.clone(), + hide.clone(), + )?; + writeln!(&mut std::io::stdout(), "{}", entity.to_json_string()?)? + } + (false, true, SearchEntityType::File) => { + let specifier = + Specifier::File(hit["ident"].as_str().unwrap().to_string()); + let entity = specifier.get_from_api( + &mut api_client, + expand.clone(), + hide.clone(), + )?; + writeln!(&mut std::io::stdout(), "{}", entity.to_json_string()?)? + } } } } |