pub fn run(&mut self, opts: &Options, optargs: &[&str]) -> (i32, String) {
        let clf = &opts.clf;

        let output = std::process::Command::new(clf)
            .args(&[
                "-c",
                &self.config_file,
                "-p",
                &self.snap_file,
                "-g",
                "Trace",
            ])
            .args(optargs)
            .output()
            .expect("unable to start clf");

        // wait a little before calling
        let timeout = std::time::Duration::from_millis(1000);
        std::thread::sleep(timeout);

        trace!("{:?}", output);
        let s = String::from_utf8_lossy(&output.stdout);

        // load json as hashmap
        self.json = self.json(&self.snap_file).unwrap_or(HashMap::new());

        (output.status.code().unwrap(), s.to_string())
    }
// call CLF executable with optional arguments
call CLF executable with optional arguments
call CLF executable with optional arguments
pub fn run(&mut self, opts: &Options, optargs: &[&str]) -> (i32, String) {
        let clf = &opts.clf;
        let output = std::process::Command::new(clf)
            .args(&[
                "-c",
                &self.config_file,
                "-p",
                &self.snap_file,
                "-g",
                "Trace",
            ])
            .args(optargs)
            .output()
            .expect("unable to start clf");
        // wait a little before calling
        let timeout = std::time::Duration::from_millis(1000);
        std::thread::sleep(timeout);
        trace!("{:?}", output);
        let s = String::from_utf8_lossy(&output.stdout);
        // load json as hashmap
        self.json = self.json(&self.snap_file).unwrap_or(HashMap::new());
        (output.status.code().unwrap(), s.to_string())
    }
pub fn run ( & mut self , opts : & Options , optargs : & [ & str ] ) -> ( i32 , String ) { let clf = & opts . clf ; let output = std :: process :: Command :: new ( clf ) . args ( & [ " " , & self . config_file , " " , & self . snap_file , " " , " " , ] ) . args ( optargs ) . output ( ) . expect ( " " ) ; // wait a little before calling let timeout = std :: time :: Duration :: from_millis ( 1000 ) ; std :: thread :: sleep ( timeout ) ; trace ! ( " " output ) ; let s = String :: from_utf8_lossy ( & output . stdout ) ; // load json as hashmap self . json = self . json ( & self . snap_file ) . unwrap_or ( HashMap :: new ( ) ) ; ( output . status . code ( ) . unwrap ( ) , s . to_string ( ) ) }
call CLF executable with optional arguments
call CLF executable with optional arguments
&mut self
opts
&Options
optargs
&[&str]
&mut self
opts
&Options
optargs
&[&str]