-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e4ddcd
commit 7e498f2
Showing
6 changed files
with
226 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
# Rust | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
[package] | ||
name = "rmdup" | ||
description = "Simple tool for removing duplicate files" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Stridsvagn69420 (https://github.com/Stridsvagn69420)"] | ||
readme = "README.md" | ||
license = "MIT" | ||
repository = "https://github.com/Stridsvagn69420/rmdup" | ||
documentation = "https://github.com/Stridsvagn69420/rmdup" | ||
categories = ["command-line-utilities", "filesystem"] | ||
keywords = ["coreutils", "command-line", "duplicate"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
blake3 = "1.4" | ||
blake3 = "1.4" | ||
kagero = { version = "0.4", default-features = false, features = ["printer"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Stridsvagn69420 | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use kagero::printer::{Colors, Printer}; | ||
|
||
/// Help Message | ||
/// | ||
/// Displays a help message for using this tool. | ||
pub(crate) fn help_message(p: &mut Printer) { | ||
p.writeln("Help Message still WIP"); | ||
} | ||
|
||
/// Version Message | ||
/// | ||
/// Prints metadata like authors and version of the program. | ||
pub(crate) fn version(p: &mut Printer) { | ||
p.writeln("Version Message still WIP"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
use std::env; | ||
use std::process::ExitCode; | ||
use kagero::printer::Printer; | ||
mod help; | ||
|
||
fn main() -> ExitCode { | ||
let mut prnt = Printer::default(); | ||
let args: Vec<String> = env::args().collect(); | ||
|
||
// Get file via command-line arguments | ||
let Some(file) = args.get(1) else { | ||
help::help_message(&mut prnt); | ||
return ExitCode::FAILURE; | ||
}; | ||
|
||
// Flag handle | ||
return match file.as_str() { | ||
"-h" | "--help" => { | ||
help::help_message(&mut prnt); | ||
ExitCode::SUCCESS | ||
}, | ||
"-V" | "--version" => { | ||
help::version(&mut prnt); | ||
ExitCode::SUCCESS | ||
}, | ||
_ => ExitCode::SUCCESS // TODO: Replace this with function call that does the acutal logic. | ||
} | ||
} |