<commit_before>use std::fmt::{Debug, Formatter, Error};

extern crate clap;
use clap::{App, ArgMatches};

pub struct ModuleConfig {
    pub load : bool,
}

impl ModuleConfig {
    pub fn new() -> ModuleConfig {
        ModuleConfig {
            load: false,
        }
    }
}

pub struct CliConfig<'a> {
    pub module_configs  : Vec<ModuleConfig>,
    pub cli_matches     : ArgMatches<'a, 'a>,
}

impl<'a> CliConfig<'a> {
    pub fn new(app : clap::App<'a, 'a, 'a, 'a, 'a, 'a>) -> CliConfig<'a> {
        CliConfig {
            module_configs: vec![],
            cli_matches: app.get_matches(),
        }
    }

    /**
     * Check whether the CLI says we should run verbose
     */
    pub fn is_verbose(&self) -> bool {
        self.cli_matches.is_present("verbose") || self.is_debugging()
    }

    /**
     * Check whether the CLI says we should run in debugging
     */
    pub fn is_debugging(&self) -> bool {
        self.cli_matches.is_present("debug")
    }

    /**
     * Get the runtime path the CLI configured
     */
    pub fn get_rtp(&self) -> Option<String> {
        self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s)))
    }

    /**
     * Get the store path the CLI configured
     *
     * TODO: Implement properly. Not working by now.
     */
    pub fn store_path(&self) -> Option<String> {
        self.get_rtp().and_then(|rtp| {
            self.cli_matches
                .value_of("storepath")
                .and_then(|s| Some(rtp + s))
        })
    }

    pub fn editor(&self) -> Option<String> {<commit_msg>Add CLI implementation for reporting<commit_after>use std::fmt::{Debug, Formatter, Error};

extern crate clap;
use clap::{App, ArgMatches};

pub struct ModuleConfig {
    pub load : bool,
}

impl ModuleConfig {
    pub fn new() -> ModuleConfig {
        ModuleConfig {
            load: false,
        }
    }
}

pub struct CliConfig<'a> {
    pub module_configs  : Vec<ModuleConfig>,
    pub cli_matches     : ArgMatches<'a, 'a>,
}

impl<'a> CliConfig<'a> {
    pub fn new(app : clap::App<'a, 'a, 'a, 'a, 'a, 'a>) -> CliConfig<'a> {
        CliConfig {
            module_configs: vec![],
            cli_matches: app.get_matches(),
        }
    }

    /**
     * Check whether the CLI says we should run verbose
     */
    pub fn is_verbose(&self) -> bool {
        self.cli_matches.is_present("verbose") || self.is_debugging()
    }

    /**
     * Check whether the CLI says we should run in debugging
     */
    pub fn is_debugging(&self) -> bool {
        self.cli_matches.is_present("debug")
    }

    /**
     * Check whether the CLI says we should run with reporting
     */
    pub fn report_exit(&self) -> bool {
        self.cli_matches.is_present("report")
    }

    /**
     * Get the runtime path the CLI configured
     */
    pub fn get_rtp(&self) -> Option<String> {
        self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s)))
    }

    /**
     * Get the store path the CLI configured
     *
     * TODO: Implement properly. Not working by now.
     */
    pub fn store_path(&self) -> Option<String> {
        self.get_rtp().and_then(|rtp| {
            self.cli_matches
                .value_of("storepath")
                .and_then(|s| Some(rtp + s))
        })
    }

    pub fn editor(&self) -> Option<String> {
{'fraction_non_alphanumeric': 0.13933192897983748, 'fraction_numerical': 0.0, 'mean_word_length': 2.1123595505617976, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1585045', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1079, 'n_words': 265}