summary refs log tree commit diff
path: root/ripple/fossil/src/bin/extract.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ripple/fossil/src/bin/extract.rs')
-rw-r--r--ripple/fossil/src/bin/extract.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/ripple/fossil/src/bin/extract.rs b/ripple/fossil/src/bin/extract.rs
index a1e83df..64e27d4 100644
--- a/ripple/fossil/src/bin/extract.rs
+++ b/ripple/fossil/src/bin/extract.rs
@@ -7,7 +7,7 @@ use {
 	prost::Message,
 	std::{
 		fs,
-		io::{self, Read, Write},
+		io::Write,
 		os::unix::{fs::symlink, prelude::OpenOptionsExt},
 		path::{Path, PathBuf},
 	},
@@ -17,6 +17,8 @@ use {
 struct Args {
 	#[clap(long, default_value = "fossil.db")]
 	store: PathBuf,
+	#[clap(parse(try_from_str = fossil::digest_from_str))]
+	root: fossil::Digest,
 }
 
 fn main() {
@@ -24,12 +26,9 @@ fn main() {
 
 	let store = fossil::Store::open(args.store).unwrap();
 	let root = {
-		let mut stdin = io::stdin();
-
-		let mut bytes = Vec::new();
-		stdin.read_to_end(&mut bytes).unwrap();
-
+		let bytes = store.read_blob(args.root);
 		let pb = store::Directory::decode(&*bytes).unwrap();
+
 		Directory::from_pb(pb)
 	};