diff --git a/Cargo.lock b/Cargo.lock index 9006668..341485e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ dependencies = [ [[package]] name = "intentrace" -version = "0.2.2" +version = "0.2.3" dependencies = [ "clone3", "colored", diff --git a/Cargo.toml b/Cargo.toml index f6335fb..eb962c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "intentrace" -version = "0.2.2" +version = "0.2.3" description = "intentrace is strace with intent, it goes all the way for you instead of half the way." edition = "2021" license = "MIT" diff --git a/src/utilities.rs b/src/utilities.rs index cdbb9eb..a6c5a26 100644 --- a/src/utilities.rs +++ b/src/utilities.rs @@ -66,6 +66,30 @@ pub fn parse_args() -> Vec { while let Some(arg) = args.peek() { match arg.as_str() { + "-h" | "--help" => { + // TODO! + // PENDING SWITCH TO CLAP + println!("intentrace is a strace for everyone. + +Usage: intentrace [OPTIONS] [-- ...] + +Options: + -c, --summary provide a summary table at the end of tracing + -p, --attach attach to an already running proceess + -f, --follow-forks trace child processes when traced programs create them + -z, --failed-only only print failed syscalls + -q, --mute-stdout mute the traced program's std output + -h, --help print help + -v, --version print version + "); + std::process::exit(0) + } + "-v" | "--version" => { + // TODO! + // PENDING SWITCH TO CLAP + println!("intentrace {}", env!("CARGO_PKG_VERSION")); + std::process::exit(0) + } "-c" | "--summary" => { let _ = args.next().unwrap(); // if FOLLOW_FORKS.get() {