diff --git a/bash-5.1/.gitignore b/bash-5.1/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6c7dbc5f085f84f2a270711cca252e16ba3e0ce4 --- /dev/null +++ b/bash-5.1/.gitignore @@ -0,0 +1,4 @@ +*.swp +tags +target/ +.vscode diff --git a/bash-5.1/Cargo.lock b/bash-5.1/Cargo.lock new file mode 100644 index 0000000000000000000000000000000000000000..80e89c60c2be1156383be4e888bad214b616729a --- /dev/null +++ b/bash-5.1/Cargo.lock @@ -0,0 +1,19 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "command1" +version = "0.1.0" + +[[package]] +name = "command2" +version = "0.1.0" + +[[package]] +name = "rsbash" +version = "0.1.0" +dependencies = [ + "command1", + "command2", +] diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..ec2f4f94e8ca1e1b1b2b3eda3ff3596abb48b863 --- /dev/null +++ b/bash-5.1/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "rsbash" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[workspace] +members = ["builtins/command1", "builtins/command2"] + +[dependencies] +command1 = {path = "./builtins/command1"} +command2 = {path = "./builtins/command2"} diff --git a/bash-5.1/builtins/command1/Cargo.toml b/bash-5.1/builtins/command1/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..97f993522ac8945cb838247d2f17590ce02d6728 --- /dev/null +++ b/bash-5.1/builtins/command1/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "command1" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/bash-5.1/builtins/command1/src/lib.rs b/bash-5.1/builtins/command1/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..4655c221b95f3d248bd79c4359da9f598b70f094 --- /dev/null +++ b/bash-5.1/builtins/command1/src/lib.rs @@ -0,0 +1,12 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + let result = 2 + 2; + assert_eq!(result, 4); + } +} + + pub fn say_hello() { + println!("hello 1111!"); + } diff --git a/bash-5.1/builtins/command2/Cargo.toml b/bash-5.1/builtins/command2/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..c32d68c9a0e07eb13c8e2e2ea8d75c91e8983671 --- /dev/null +++ b/bash-5.1/builtins/command2/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "command2" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/bash-5.1/builtins/command2/src/lib.rs b/bash-5.1/builtins/command2/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..a31d1d737a500d247d7be3b9b30b18132fb1e701 --- /dev/null +++ b/bash-5.1/builtins/command2/src/lib.rs @@ -0,0 +1,11 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + let result = 2 + 2; + assert_eq!(result, 4); + } +} +pub fn hello2() { + println!("222222222222222"); +} diff --git a/bash-5.1/src/main.rs b/bash-5.1/src/main.rs new file mode 100644 index 0000000000000000000000000000000000000000..b1ec861f325d7966834d67593d6472b36ebf3afe --- /dev/null +++ b/bash-5.1/src/main.rs @@ -0,0 +1,10 @@ +use command1::say_hello; +use command2::hello2; + + +fn main() { + hello2(); + say_hello(); + println!("Hello, world!"); + //execute_cmd(); +} diff --git a/record.txt b/record.txt index 099b7d91c923c6fc0fdaaea4be224d5d9d4fcfca..a4265686e0eb7910dbc7902e6ceeb2d39c320867 100644 --- a/record.txt +++ b/record.txt @@ -2,3 +2,4 @@ 2 1 2 +3