diff --git a/Cargo.toml b/Cargo.toml index 30fd35f..7a6dc67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/k3ii/qdir" homepage = "https://github.com/k3ii/qdir" readme = "README.md" keywords = ["cli"] -categories = ["cli"] +categories = ["command-line-utilities"] [dependencies] clap = { version = "4.5.16", features = ["derive", "cargo"] } diff --git a/src/lib.rs b/src/lib.rs index 7823565..92347f1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,12 +39,4 @@ pub fn make_dir(depth: u8, name_length: usize, name: bool, pet: bool, tmp: bool) fs::create_dir_all(&path).expect("Failed to create directory"); println!("{}", path.display()); - - let name = get_random_name().unwrap_or_else(|| String::from("default_name")); - let pet = get_random_pet() - .unwrap_or_else(|| "default_pet") - .to_string(); - - println!("Name: {}", name); - println!("Pet: {}", pet); } diff --git a/src/main.rs b/src/main.rs index 1e564c3..708ba1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use clap::{command, Arg}; +use clap::{command, Arg, ArgGroup}; use qdir::make_dir; fn main() { @@ -41,6 +41,11 @@ fn main() { .action(clap::ArgAction::SetTrue) .help("Use the system's temporary directory"), ) + .group( + ArgGroup::new("name_or_pet_length") + .args(&["name", "pet", "length"]) + .required(false), + ) .get_matches(); let depth = matches