pub fn run(matches: ArgMatches) {
    loggerv::init_with_verbosity(matches.occurrences_of("v")).unwrap();

    let sensor_boxed = get_sensor(&matches);
    let exporter_parameters;

    let mut header = true;
    if matches.is_present("no-header") {
        header = false;
    }

    if let Some(stdout_exporter_parameters) = matches.subcommand_matches("stdout") {
        if header {
            scaphandre_header("stdout");
        }
        exporter_parameters = stdout_exporter_parameters.clone();
        let mut exporter = StdoutExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(json_exporter_parameters) = matches.subcommand_matches("json") {
        if header {
            scaphandre_header("json");
        }
        exporter_parameters = json_exporter_parameters.clone();
        let mut exporter = JSONExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(riemann_exporter_parameters) = matches.subcommand_matches("riemann") {
        if header {
            scaphandre_header("riemann");
        }
        exporter_parameters = riemann_exporter_parameters.clone();
        let mut exporter = RiemannExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(prometheus_exporter_parameters) = matches.subcommand_matches("prometheus") {
        if header {
            scaphandre_header("prometheus");
        }
        exporter_parameters = prometheus_exporter_parameters.clone();
        let mut exporter = PrometheusExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(qemu_exporter_parameters) = matches.subcommand_matches("qemu") {
        if header {
            scaphandre_header("qemu");
        }
        exporter_parameters = qemu_exporter_parameters.clone();
        let mut exporter = QemuExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(warp10_exporter_parameters) = matches.subcommand_matches("warp10") {
        if header {
            scaphandre_header("warp10");
        }
        exporter_parameters = warp10_exporter_parameters.clone();
        let mut exporter = Warp10Exporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else {
        error!("Couldn't determine which exporter has been chosen.");
    }
}
/// Matches the sensor and exporter name and options requested from the command line and
/// creates the appropriate instances. Launchs the standardized entrypoint of
/// the choosen exporter: run()
/// This function should be updated to take new exporters into account.
Matches the sensor and exporter name and options requested from the command line and
creates the appropriate instances. Launchs the standardized entrypoint of
the choosen exporter: run()
This function should be updated to take new exporters into account.
Matches the sensor and exporter name and options requested from the command line and creates the appropriate instances . Launchs the standardized entrypoint of the choosen exporter : run () This function should be updated to take new exporters into account .
pub fn run(matches: ArgMatches) {
    loggerv::init_with_verbosity(matches.occurrences_of("v")).unwrap();
    let sensor_boxed = get_sensor(&matches);
    let exporter_parameters;
    let mut header = true;
    if matches.is_present("no-header") {
        header = false;
    }
    if let Some(stdout_exporter_parameters) = matches.subcommand_matches("stdout") {
        if header {
            scaphandre_header("stdout");
        }
        exporter_parameters = stdout_exporter_parameters.clone();
        let mut exporter = StdoutExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(json_exporter_parameters) = matches.subcommand_matches("json") {
        if header {
            scaphandre_header("json");
        }
        exporter_parameters = json_exporter_parameters.clone();
        let mut exporter = JSONExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(riemann_exporter_parameters) = matches.subcommand_matches("riemann") {
        if header {
            scaphandre_header("riemann");
        }
        exporter_parameters = riemann_exporter_parameters.clone();
        let mut exporter = RiemannExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(prometheus_exporter_parameters) = matches.subcommand_matches("prometheus") {
        if header {
            scaphandre_header("prometheus");
        }
        exporter_parameters = prometheus_exporter_parameters.clone();
        let mut exporter = PrometheusExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(qemu_exporter_parameters) = matches.subcommand_matches("qemu") {
        if header {
            scaphandre_header("qemu");
        }
        exporter_parameters = qemu_exporter_parameters.clone();
        let mut exporter = QemuExporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else if let Some(warp10_exporter_parameters) = matches.subcommand_matches("warp10") {
        if header {
            scaphandre_header("warp10");
        }
        exporter_parameters = warp10_exporter_parameters.clone();
        let mut exporter = Warp10Exporter::new(sensor_boxed);
        exporter.run(exporter_parameters);
    } else {
        error!("Couldn't determine which exporter has been chosen.");
    }
}
pub fn run ( matches : ArgMatches ) { loggerv :: init_with_verbosity ( matches . occurrences_of ( " " ) ) . unwrap ( ) ; let sensor_boxed = get_sensor ( & matches ) ; let exporter_parameters ; let mut header = true ; if matches . is_present ( " " ) { header = false ; } if let Some ( stdout_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = stdout_exporter_parameters . clone ( ) ; let mut exporter = StdoutExporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else if let Some ( json_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = json_exporter_parameters . clone ( ) ; let mut exporter = JSONExporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else if let Some ( riemann_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = riemann_exporter_parameters . clone ( ) ; let mut exporter = RiemannExporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else if let Some ( prometheus_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = prometheus_exporter_parameters . clone ( ) ; let mut exporter = PrometheusExporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else if let Some ( qemu_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = qemu_exporter_parameters . clone ( ) ; let mut exporter = QemuExporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else if let Some ( warp10_exporter_parameters ) = matches . subcommand_matches ( " " ) { if header { scaphandre_header ( " " ) ; } exporter_parameters = warp10_exporter_parameters . clone ( ) ; let mut exporter = Warp10Exporter :: new ( sensor_boxed ) ; exporter . run ( exporter_parameters ) ; } else { error ! ( " " ) ; } }
Matches the sensor and exporter name and options requested from the command line and
creates the appropriate instances.
Matches the sensor and exporter name and options requested from the command line and creates the appropriate instances .
matches
ArgMatches
matches
ArgMatches