summary refs log tree commit diff
path: root/ripple/fossil
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-05-03 00:13:43 +0000
committeredef <edef@unfathomable.blue>2022-05-03 00:13:43 +0000
commitf8829efb3b7967881253ff0cd2b22ddae2a7b589 (patch)
tree2de6597a1e0ca1864ffa0fc8aae9ce7091f94019 /ripple/fossil
parent5c544de74b64fc08029d09d12ecde894b5e78078 (diff)
ripple/fossil: make store path configurable
Change-Id: Ic410619a6115a7059b79593c6fade38236d4e8c1
Diffstat (limited to 'ripple/fossil')
-rw-r--r--ripple/fossil/src/bin/add.rs4
-rw-r--r--ripple/fossil/src/bin/extract.rs11
-rw-r--r--ripple/fossil/src/bin/mount.rs10
3 files changed, 17 insertions, 8 deletions
diff --git a/ripple/fossil/src/bin/add.rs b/ripple/fossil/src/bin/add.rs
index 7768366..84e67e2 100644
--- a/ripple/fossil/src/bin/add.rs
+++ b/ripple/fossil/src/bin/add.rs
@@ -15,12 +15,14 @@ use {
 struct Args {
 	#[clap(name = "PATH")]
 	paths: Vec<PathBuf>,
+	#[clap(long, default_value = "fossil.db")]
+	store: PathBuf,
 }
 
 fn main() {
 	let args = Args::parse();
 
-	let store = fossil::Store::open("fossil.db").unwrap();
+	let store = fossil::Store::open(args.store).unwrap();
 	let mut root = Directory::new();
 
 	for name in args.paths {
diff --git a/ripple/fossil/src/bin/extract.rs b/ripple/fossil/src/bin/extract.rs
index cb45896..a1e83df 100644
--- a/ripple/fossil/src/bin/extract.rs
+++ b/ripple/fossil/src/bin/extract.rs
@@ -9,17 +9,20 @@ use {
 		fs,
 		io::{self, Read, Write},
 		os::unix::{fs::symlink, prelude::OpenOptionsExt},
-		path::Path,
+		path::{Path, PathBuf},
 	},
 };
 
 #[derive(clap::Parser)]
-struct Args {}
+struct Args {
+	#[clap(long, default_value = "fossil.db")]
+	store: PathBuf,
+}
 
 fn main() {
-	let _args = Args::parse();
+	let args = Args::parse();
 
-	let store = fossil::Store::open("fossil.db").unwrap();
+	let store = fossil::Store::open(args.store).unwrap();
 	let root = {
 		let mut stdin = io::stdin();
 
diff --git a/ripple/fossil/src/bin/mount.rs b/ripple/fossil/src/bin/mount.rs
index ae26fbb..5a5f276 100644
--- a/ripple/fossil/src/bin/mount.rs
+++ b/ripple/fossil/src/bin/mount.rs
@@ -11,6 +11,7 @@ use {
 	std::{
 		cell::RefCell,
 		io::{self, Read, Seek},
+		path::PathBuf,
 		time::{Duration, SystemTime, UNIX_EPOCH},
 	},
 };
@@ -73,13 +74,16 @@ fn file_attr(ino: u64, node: &memtree::Node) -> fuser::FileAttr {
 }
 
 #[derive(clap::Parser)]
-struct Args {}
+struct Args {
+	#[clap(long, default_value = "fossil.db")]
+	store: PathBuf,
+}
 
 fn main() {
 	env_logger::init();
-	let _args = Args::parse();
+	let args = Args::parse();
 
-	let store = fossil::Store::open("fossil.db").unwrap();
+	let store = fossil::Store::open(args.store).unwrap();
 	let root = memtree::load_root(&store, {
 		let mut stdin = io::stdin();