-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Time: Parse CLI opts, run subprocess and extract resource usage
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,5 +1,14 @@ | ||
mod cli; | ||
mod subprocess; | ||
|
||
use coreutils_core::os::resource::{get_rusage, ResourceConsumer}; | ||
|
||
fn main() { | ||
let _ = cli::create_app().get_matches(); | ||
let opts = cli::TimeOpts::new(); | ||
let (exit_status, duration) = match subprocess::timed_run(&opts.command) { | ||
Ok(rv) => rv, | ||
Err(err) => subprocess::exit_with_msg(err), | ||
}; | ||
|
||
let usage = get_rusage(ResourceConsumer::Children); | ||
} |