File: async.rs

package info (click to toggle)
rust-command-group 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
//! This example shows the basic usage of the async version
//! of the `group_spawn` method, and collects the exit code.

use command_group::AsyncCommandGroup;

#[tokio::main]
async fn main() {
	let mut handle = tokio::process::Command::new("ls").group_spawn().unwrap();
	println!("{:?}", handle);
	let exit_code = handle.wait().await;
	println!("{:?}", exit_code);
}