1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::process::Command;

use crate::{ADBCommand, ADBResult};

#[derive(Default)]
pub struct ADBHelp {}

impl ADBCommand for ADBHelp {
    fn build(&self) -> Result<Command, String> {
        let mut shell = Command::new("adb");
        shell.arg("help");
        Ok(shell)
    }

    fn process_output(&self, output: ADBResult) -> ADBResult {
        ADBResult {
            data: output
                .data
                .get(output.data.find("global options").unwrap()..output.data.len())
                .unwrap()
                .to_owned(),
        }
    }
}