This commit is contained in:
2025-04-09 09:47:16 +02:00
parent 60e688810d
commit 28a7ef3a94
6 changed files with 29 additions and 10 deletions

View File

@@ -3,6 +3,10 @@ name = "doctreecmd"
version = "0.1.0"
edition = "2024"
[[bin]]
name = "doctree"
path = "src/main.rs"
[dependencies]
doctree = { path = "../doctree" }
clap = "3.2.25"

View File

@@ -3,7 +3,7 @@ use doctree::{DocTree, RedisStorage, Result, from_directory};
use std::path::Path;
fn main() -> Result<()> {
let matches = App::new("DocTree CLI")
let matches = App::new("doctree")
.version("0.1.0")
.author("Your Name")
.about("A tool to manage document collections")
@@ -53,7 +53,7 @@ fn main() -> Result<()> {
.arg(Arg::with_name("doctree").long("doctree").takes_value(true).help("Name of the doctree (default: 'default')")),
)
.subcommand(
SubCommand::with_name("delete-collection")
SubCommand::with_name("delete")
.about("Delete a collection from Redis")
.arg(Arg::with_name("collection").required(true).help("Name of the collection"))
.arg(Arg::with_name("doctree").long("doctree").takes_value(true).help("Name of the doctree (default: 'default')")),
@@ -266,7 +266,7 @@ fn main() -> Result<()> {
}
}
}
} else if let Some(matches) = matches.subcommand_matches("delete-collection") {
} else if let Some(matches) = matches.subcommand_matches("delete") {
let collection = matches.value_of("collection").unwrap();
let doctree_name = matches.value_of("doctree").unwrap_or("default");