summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..893b9f5
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,27 @@
+mod trace;
+
+use crate::trace::{exec, trace};
+use clap::Parser;
+use std::process::Command;
+
+#[derive(Parser)]
+#[command(author, version, about, long_about = None)]
+struct Args {
+ command: String,
+}
+
+fn main() -> anyhow::Result<()> {
+ let args = Args::parse();
+ let params = args.command.split(' ').collect::<Vec<&str>>();
+
+ let mut command = Command::new(params[0]);
+ if params.len() > 1 {
+ for arg in &params[1..] {
+ command.arg(arg);
+ }
+ }
+ let pid = exec(&mut command)?;
+ trace(pid)?;
+
+ Ok(())
+}