From 60daca96caac7c6a2f6c795fb39737c06f647910 Mon Sep 17 00:00:00 2001 From: endernon Date: Tue, 3 Dec 2024 23:29:50 +0000 Subject: [PATCH] Add LICENSE and README --- LICENSE | 21 +++++++++++++++++++++ readme.md | 15 +++++++++++++++ src/main.rs | 46 ++++++++++++++++++++++++---------------------- 3 files changed, 60 insertions(+), 22 deletions(-) create mode 100644 LICENSE create mode 100644 readme.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3509eb0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 endernon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d569b75 --- /dev/null +++ b/readme.md @@ -0,0 +1,15 @@ +# respack-decrypter + +This tool + +# I want some logs + +Pipe your output to a new filename. + +Note: It might not work for SOME linux shells. But major ones e.g. `zsh`,`bash` support it. + +`respack-decrypter --path ~/somedir > ~/log.txt` + +# License + +It's all MIT, except the example inventory.png which is courtesy of Wynncraft. Zeer you better not come after me for this one \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8a36f43..af2549c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,12 +9,14 @@ use std::path::{Path, PathBuf}; #[command(version, about, long_about = None)] struct Args { /// Input path + /// + /// Include a file path or a directory path. Do not use any asterisks or wildcards. #[arg(short, long)] - path: Vec, + path: PathBuf, /// Output path - #[arg(short, long)] - out: Option, + #[arg(short, long,default_value="")] + out: PathBuf, /// Debug mode #[arg(short, long, default_value_t=false)] @@ -44,29 +46,29 @@ fn main() { if pathtype.is_file() { } -// else if pathtype.is_dir() { -// // parse file list if it's a dir -// for entry in glob(&format!("{}/**/*.png", pathfr.clone().display())).expect("Failed to read glob pattern (you should panic)") { -// match entry { -// Ok(path) => { -// // println!("{:?}", path.display()); -// filelist.push(path.display().to_string()); -// }, -// Err(e) => { -// println!("Shell globbing error"); -// } -// } -// } -// } -// else { -// panic!("") -// } -// + else if pathtype.is_dir() { + // parse file list if it's a dir + for entry in glob(&format!("{}/**/*.png", pathfr.clone().display())).expect("Failed to read glob pattern (you should panic)") { + match entry { + Ok(path) => { + // println!("{:?}", path.display()); + filelist.push(path.display().to_string()); + }, + Err(e) => { + println!("Shell globbing error"); + } + } + } + } + else { + panic!("that input is neither file nor dir and thats scary") + } + if realdebugmode { for i in filelist { - println!("{i}") + println!("List of files: {i}") } }