You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: shell.rs
    path of file: ./repos/yazi/yazi-plugin/src/external
    
    the code of the file until where you have to start completion: use std::{env, ffi::OsString, process::Stdio};

use anyhow::Result;
use tokio::process::{Child, Command};

#[derive(Default)]
pub struct ShellOpt {
	pub cmd:    OsString,
	pub args:   Vec<OsString>,
	pub piped:  bool,
	pub orphan: bool,
}

impl ShellOpt {
	pub fn with_piped(mut self) -> Self {
		self.piped = true;
		self
	}

	#[inline]
	fn stdio(&self) -> Stdio {
		if self.orphan {
			Stdio::null()
		} else if self.piped {
			Stdio::piped()
		} else {
			Stdio::inherit()
		}
	}
}

pub fn shell(opt: ShellOpt) -> Result<Child> {
	let level = env::var("YAZI_LEVEL").ok().and_then(|s| s.parse::<u32>().ok()).unwrap_or(0);

	#[cfg(unix)]
	return Ok(unsafe {
		Command::new("sh")
			.env("YAZI_LEVEL", (level + 1).to_string())
			.arg("-c")
	
    
	fn next_string(it: &mut Peekable<Chars<'_>>, args: &[&str], s: &mut String, c: char) {
		if c == '\\' {
			match it.next() {
				Some('\\') => s.push('\\'), // \\  ==>  \
				Some('\'') => s.push('\''), // \'  ==>  '
				Some('"') => s.push('"'),   // \"  ==>  "
				Some('%') => s.push('%'),   // \%  ==>  %
				Some('n') => s.push('\n'),  // \n  ==>  '\n'
				Some('t') => s.push('\t'),  // \t  ==>  '\t'
				Some('r') => s.push('\r'),  // \r  ==>  '\r'
				Some(c) => {
					s.push('\\');
					s.push(c);
				}
				None => s.push('\\'),
			}
		} else if c == '%' {
			match it.peek() {
				Some('*') => {
					if args.len() > 1 {
						s.push_str(&args[1..].join(" "));
					}
					it.next();
				}
				Some(n) if n.is_ascii_digit() => {
					let mut pos = n.to_string();

					it.next();
					while let Some(&n) = it.peek() {
						if n.is_ascii_digit() {
							pos.push(it.next().unwrap());
						} else {
							break;
						}
					}

					if let Some(arg) = args.get(pos.parse::<usize>().unwrap()) {
						s.push_str(arg);
					}
				}
				_ => s.push('%'),
			}
		} else {
			s.push(c);
		}
	}