adb_utils/commands/general/
help.rs

1use std::process::Command;
2
3use crate::{ADBCommand, ADBResult};
4
5/// Show the help message
6pub struct ADBHelp {
7    shell: Command,
8}
9
10impl Default for ADBHelp {
11    fn default() -> Self {
12        let mut cmd = Command::new("adb");
13        cmd.arg("help");
14
15        Self { shell: cmd }
16    }
17}
18impl ADBCommand for ADBHelp {
19    fn build(&mut self) -> Result<&mut Command, String> {
20        Ok(&mut self.shell)
21    }
22
23    fn process_output(&self, output: ADBResult) -> ADBResult {
24        ADBResult {
25            data: output
26                .data
27                .get(output.data.find("global options").unwrap()..output.data.len())
28                .unwrap()
29                .to_owned(),
30        }
31    }
32}