From 43e20b46c725d3eb8a2424bdf34cd1cad0607398 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Wed, 6 Sep 2023 13:35:18 +0200 Subject: [PATCH] init --- .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 8 ++++++++ rustfmt.toml | 1 + src/main.rs | 21 +++++++++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 rustfmt.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..8906511 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "wasted" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..605d1d6 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "wasted" +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/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c865a1f --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +hard_tabs = true diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..9f20560 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,21 @@ +use std::{env, process::Command, time::SystemTime}; + +fn main() { + let start_time = SystemTime::now(); + let args: Vec = env::args().collect(); + + println!("{:?}", args); + if args.len() < 2 { + println!("Not enough arguments."); + return; + } + let cmd = &args[1]; + + println!("starting build"); + let process = Command::new(cmd).args(&args[2..]).status(); + + println!("\n"); + println!("{:?}", process); + let time_taken = start_time.elapsed().unwrap(); + println!("Took {:?}", time_taken); +}