-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
124 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Rust target directory (output files) | ||
target/ | ||
|
||
# Build artifacts | ||
**/*.rs.bk | ||
*.rlib | ||
*.lock | ||
|
||
# Dependencies | ||
Cargo.lock | ||
/.cargo/ | ||
target/ | ||
debug/ | ||
release/ | ||
|
||
# IDE/Editor config files | ||
.idea/ | ||
.vscode/ | ||
*.iml | ||
|
||
# Temporary files | ||
*.tmp | ||
*.log | ||
*.bak | ||
*.swp | ||
|
||
# MacOS-specific | ||
.DS_Store | ||
|
||
# Node.js/npm (optional if using Node for scripts) | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
pnpm-debug.log | ||
|
||
# Rust language server | ||
rls/ | ||
.clippy/ | ||
rustfmt.toml | ||
|
||
# Environment variables | ||
.env | ||
|
||
# Key files (Ensure sensitive data is not committed) | ||
*.key | ||
*.pem | ||
*.json | ||
key.json |
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,8 @@ | ||
[workspace] | ||
members = [ | ||
"kug-cli", | ||
"kug-core", | ||
"kug-utils" | ||
] | ||
|
||
resolver = "2" |
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,11 @@ | ||
[package] | ||
name = "kug-cli" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
clap = { version = "4.0", features = ["derive"] } | ||
kug-core = { path = "../kug-core" } | ||
kug-utils = { path = "../kug-utils" } |
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,13 @@ | ||
use clap::Parser; | ||
use kug_utils::greet; | ||
|
||
#[derive(Parser)] | ||
struct Cli { | ||
#[arg(short, long)] | ||
name: String, | ||
} | ||
|
||
fn main() { | ||
let args = Cli::parse(); | ||
greet(&args.name); | ||
} |
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,8 @@ | ||
[package] | ||
name = "kug-core" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
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,12 @@ | ||
pub fn core_functionality() { | ||
println!("Kug-core: Core functionality activated."); | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
let result = 2 + 2; | ||
assert_eq!(result, 4); | ||
} | ||
} |
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,8 @@ | ||
[package] | ||
name = "kug-utils" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
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,16 @@ | ||
pub fn greet(name: &str) { | ||
println!("Hello from {}!", name); | ||
} | ||
|
||
pub fn validate_data(data: &str) -> bool { | ||
!data.is_empty() | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
let result = 2 + 2; | ||
assert_eq!(result, 4); | ||
} | ||
} |